# Ruby tail

**URL:** <https://www.ruby-forum.com/t/ruby-tail/86440>\
**Category:** Ruby\
**Created:** [February 22, 2007, 10:13am UTC](https://www.ruby-forum.com/t/ruby-tail/86440 "2007-02-22T10:13:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [February 22, 2007, 10:13am UTC](https://www.ruby-forum.com/t/ruby-tail/86440/1 "2007-02-22T10:13:56Z")

</div>

Hello,

Is there a gem or perhaps a method I am not aware of that does the  
similar function of tail? Or is there a way to use tail in ruby? I  
have a file that I want to process as new data is appended to the file.  
This is easy enough using tail and tail has the added advantage that it  
can follow a file if it is “rolled”.

TIA,  
Phy

---

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [February 22, 2007, 10:33am UTC](https://www.ruby-forum.com/t/ruby-tail/86440/2 "2007-02-22T10:33:59Z")

</div>

> Is there a gem or perhaps a method I am not aware of that does the similar function of tail? Or is there a way to use tail in ruby? I have a file that I want to process as new data is appended to the file. This is easy enough using tail and tail has the added advantage that it can follow a file if it is “rolled”.

Just call out to tail

def tail(f)  
`tail f`  
end

or similar - if tail does what you want, use it

Kev

---

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [February 22, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/ruby-tail/86440/3 "2007-02-22T16:22:55Z")

</div>

Phy P. schrieb:

> * * *
> 
> Do you Yahoo!?  
> Everyone is raving about the all-new Yahoo! Mail beta.  
> [http://new.mail.yahoo.com](http://new.mail.yahoo.com)

os independent, but slower on large files.

a = File.open(file).to\_a  
-10.upto(-1) do |i|  
puts a[i]  
end

need to be beautified 🙂

---

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [February 22, 2007, 5:27pm UTC](https://www.ruby-forum.com/t/ruby-tail/86440/4 "2007-02-22T17:27:14Z")

</div>

from: Phy P. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
Is there a gem or perhaps a method I am not aware of that does the  
similar function of tail?

[http://raa.ruby-lang.org/project/file-tail/](http://raa.ruby-lang.org/project/file-tail/)

---

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [June 5, 2008, 9:30pm UTC](https://www.ruby-forum.com/t/ruby-tail/86440/5 "2008-06-05T21:30:04Z")

</div>

PeÃ±a, Botp wrote:

> from: Phy P. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
> Is there a gem or perhaps a method I am not aware of that does the  
> similar function of tail?
> 
> [http://raa.ruby-lang.org/project/file-tail/](http://raa.ruby-lang.org/project/file-tail/)

Hi all,

just try this here:

gem install file-tail -r

bye  
Henry

---

<div class="post-metadata">

**Author:** ![Phy\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@Phy\_P](https://www.ruby-forum.com/u/Phy_P)\
**Post date:** [June 6, 2008, 1:46am UTC](https://www.ruby-forum.com/t/ruby-tail/86440/6 "2008-06-06T01:46:56Z")

</div>

On Jun 5, 3:29 pm, Heinrich P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> gem install file-tail -r
> 
> ## bye Henry
> 
> Posted viahttp://www.ruby-forum.com/.

[http://tailforwin32.sourceforge.net/](http://tailforwin32.sourceforge.net/)
