I don’t seem to understand the concept of IO streams. I have figured
out how to open up files, but I don’t seem to be able to do much with
them. some documentation has clued me into things like each_line or
each_byte, but I still don’t really understand the whole deal.
could someone please give me a quick rundown on the basics of file
access, IO, and data flow from said files?
–Camden Buzard
I don’t seem to understand the concept of IO streams. I have figured
out how to open up files, but I don’t seem to be able to do much with
them. some documentation has clued me into things like each_line or
each_byte, but I still don’t really understand the whole deal.
could someone please give me a quick rundown on the basics of file
access, IO, and data flow from said files?
–Camden Buzard
In the list “Things That Ruby Newcomers Should Know” there are some helpful
references, especially “Programming Ruby”, that will help you here.
Basically:
File.open(path) do |file|
file.each_line do |line|
puts “> #{line}”
end
end
Gavin
···
From: “Camden Buzard” camdenb@hotmail.com