OK, keeping it simple I am basically using the following code:

IO.popen("ruby my_program.rb", "r+") do |f|

while(process hasn't finished)  # need ruby code for this

read = f.gets
while(read != nil)
print read
read = f.gets
end

while(waiting for input)   #need ruby code for this
write "xyz"
end

end
end


- I need to be able to test whether or not the ruby program is waiting 
for input
- I would also like to be able to test whether or not the program has 
finished  running

Can anybody help me please.

-- 
Posted via http://www.ruby-forum.com/.