you open up an I/O stream with dir : IO.popen « File Directory « Ruby






you open up an I/O stream with dir


# read the lines one by one, as with other forms of I/O streams, and close the stream

ls = IO.popen("dir", "r")
while line = ls.gets
  puts line
end
ls.close

 








Related examples in the same category

1.open a program with a read/write I/O stream and handle data in both directions
2.Open a file and write string into it
3.IO.popen("-")