open a program with a read/write I/O stream and handle data in both directions : IO.popen « File Directory « Ruby






open a program with a read/write I/O stream and handle data in both directions


handle = IO.popen("other_program", "r+")
handle.puts "send input to other program"
handle.close_write
while line = handle.gets
  puts line
end

 








Related examples in the same category

1.you open up an I/O stream with dir
2.Open a file and write string into it
3.IO.popen("-")