File input/output: Difference between revisions

Line 341:
begin
#both files are closed automatically at the end of their attached blocks
File.newopen("output.txt", "w") do |outputf|
File.open("input.txt") do |inputf|
outputf << inputf.each_line do | line |read
outputf.puts line
end
end
end
Anonymous user