Forum: Ruby Re: ruby tail

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
555c1193071e97926fa67c038244c047?d=identicon&s=25 Phy Prabab (Guest)
on 2007-02-22 11:24
(Received via mailing list)
Benj,

how would that work?

TIA,
Phy

----- Original Message ----
From: "benjohn@fysh.org" <benjohn@fysh.org>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
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 topic is locked and can not be replied to.