Ruby tail

The issue there is that how do I detect new output and then capture that output as in tail -f <file>?

···

----- Original Message ----
From: Kevin Jackson <foamdino@gmail.com>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Sent: Thursday, February 22, 2007 1:33:19 AM
Subject: Re: ruby tail

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

____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html