From: Matthew Williams Date: 2006-11-17T02:53:26+09:00 Subject: Re: testing whether a process has completed.. > I'm not sure how to do this directly, or if this is even possible in > Ruby, I refuse to accept that this is not possible in Ruby (although I still am unable to do this neatly). Can someone PLEASE shed some light, this has caused me soo much anguish.. ..in case you don't want to read though the posts then i would like to know the following: - I am running a Ruby program from my Rails application using: > thread = Thread.new do > IO.popen("ruby my_program.rb", "r+") do |pipe| > while !pipe.eof > NOW - I NEED TO KNOW HOW TO CHECK IF THE RUBY PROGRAM IS WAITING FOR INPUT ..i can read from it by reading and then checking if this returns 'nil'; if it is not equal to 'nil' then i will print it. i.e. i am trying to simulate the behaviour of a standard command prompt. BUT i cannot check if i need to write something to the program. NOTE: all Ruby programs have "STDOUT.sync = true" in them. Any ideas? -- Posted via http://www.ruby-forum.com/.