Ruby tail

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

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

Phy P. schrieb:


Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
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 :slight_smile:

from: Phy P. [mailto:[email protected]]
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/

Peña, Botp wrote:

from: Phy P. [mailto:[email protected]]
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/

Hi all,

just try this here:

gem install file-tail -r

bye
Henry

On Jun 5, 3:29 pm, Heinrich P. [email protected] wrote:

gem install file-tail -r

bye
Henry

Posted viahttp://www.ruby-forum.com/.

http://tailforwin32.sourceforge.net/