From: Phrogz Date: 2007-12-14T02:47:15+09:00 Subject: Re: read in file On Dec 13, 10:29 am, Phrogz wrote: > On Dec 13, 8:27 am, Sebastian Hungerecker > wrote: > > > Mike McKinney wrote: > > > File.open('out.txt', 'w') do |out| > > > File.open('test.txt', 'r').each do |line| > > > out.puts line if (line.size > 4) > > > end > > > end > > > That leaves test.txt open which is not good. Don't use File.open in chains > > like that. Or better yet: Don't use File.open without a block at all. > > He is using the block form of File.open, which is guaranteed to close > the file at the end. Right? Nevermind; my reading comprehension seems to be turned off this morning.