Prcoessing outoput from tail

What happens in the middle of a read from tail when the thread is interrupted? I have yet to get that stage where I can test this, but it is something I need to watch out for. Would hate to have a short read - only get half the data!

TIA!
Phy

···

----- Original Message ----
From: Gustav Paul <gustav@rails.co.za>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Sent: Saturday, March 24, 2007 4:44:25 PM
Subject: Re: Prcoessing outoput from tail

Phy Prabab wrote:

Cool, thanks I will check this out. In the mean time I think I figured out a work around, the only problem left is to figure out how to make this thread-able:

IO.popen('tail -F foo.txt') {|file|
   while line = file.gets
   puts line
   end
}

The "while line" was what helped and I even tried the file rolling and tail complained but picked up the new file, so ijust need to process that error. Do you see any advantage using this over the gem (this way I don't have to make everyone download the gem as well).

TIA!
Phy
  

Great! Looks like that works fine. I haven't used the file-tail gem,
just remember having seen it somewhere a while ago, so I can't give you
much feedback on it. You mention making the code 'thread-able'...what do
you mean exactly?

Gustav

____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html