From: Michael Steinfeld Date: 2008-06-26T01:09:51+09:00 Subject: Re: File writing On Wed, Jun 25, 2008 at 11:48 AM, Justin To wrote: > Hi, I know you can write to a file using 'w', but this erases all the > previous data. How can I add new items to an existing document without > losing the data? filename = File.open("test","a") do |f| f.puts "append to file"; f.close(); end > > Thanks! > -- > Posted via http://www.ruby-forum.com/. > >