Re: ruby tail

Benj,

how would that work?

TIA,
Phy

----- Original Message ----
From: “[email protected][email protected]
To: ruby-talk ML [email protected]
Sent: Thursday, February 22, 2007 2:05:06 AM
Subject: Re: ruby tail

exec are the same - someone with better ruby knowledge may be able to
offer a solution - perhaps using threads or something
Use IO.popen:

IO.popen(‘tail -f sim.out’){|f|
while line = f.gets
p line
end
}

Out of interest, the blocking call is “gets” here, right? Can you use
Kernel.select on a bunch of those handles?

Cheers,
Benj

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs