From: Damjan Rems Date: 2007-06-19T18:52:11+09:00 Subject: Re: When file gets closed in a block > > You can write as often as you like to f as long as you don't close it. > > File#open closes the file automatically if passed a block: > > --- > File.open('someFilename', 'w') {|f| > f.write(text1) > f.write(text2) > } I guess then my one liner should look like this: File.new(cName,'wb+') { |f|.write('aText') } by TheR -- Posted via http://www.ruby-forum.com/.