Mega Code Archive
Categories
/
Ruby
/
File Directory
You open up an IO 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