open a program with a read/write I/O stream and handle data in both directions : IO.popen « File Directory « Ruby
- Ruby
- File Directory
- IO.popen
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