[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ruby tail

Patrick Plattes

2/22/2007 3:22:00 PM

Phy Prabab schrieb:
> 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
>
>
>
>
>
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail...

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 :-)