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 :-)
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: ruby tail
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password