On Tue, 28 Mar 2006 karl_brodowsky / yahoo.com wrote:

> There should be methods on Unix and Linux using select or something like
> that.  At least Unix and Posix provide the functionality you are asking
> already at OS-level, so it is just a matter of if and how to access this
> from Ruby.  I would prefer this OS-dependent approach.

here ya go:

     harp:~ > cat a.rb
     require 'io/wait'

     puts Time.now
     STDIN.wait unless STDIN.ready?
     puts Time.now

     puts STDIN.gets

     harp:~ > cat b.rb
     sleep 2
     puts 42


     harp:~ > ruby b.rb | ruby a.rb
     Mon Mar 27 16:10:42 MST 2006
     Mon Mar 27 16:10:44 MST 2006
     42


kind regards.

-a
-- 
share your knowledge.  it's a way to achieve immortality.
- h.h. the 14th dali lama