Open a file and write string into it : IO.popen « File Directory « Ruby






Open a file and write string into it


check = IO.popen("spell","r+")
check.puts("A")
check.puts("D")
check.close_write
list = check.readlines
list.collect! { |x| x.chomp }

 








Related examples in the same category

1.you open up an I/O stream with dir
2.open a program with a read/write I/O stream and handle data in both directions
3.IO.popen("-")