Bil Kleb wrote: > ChrisH wrote: > >> Bil Kleb wrote: >> ... >> >>> She says that she can't figure out how to /append/ >>> to a CSV file using Ruby's standard library. >> >> ... >> >> Wouldn't it just be a matter of opening the file in append mode? > > > It would, but unfortunately CSV doesn't support 'a' > or 'a+', viz, lib/ruby/1.8/csv.rb, Well, darn. All I can think of offhand is 1) write the new stuff to a new file and then 2) use fileutils to append the new file onto the old one. Disclaimers: 1. I'm not sure fileutils has a good way to do that, but if it doesn't, there's always system("cat newfile >>oldfile"). 2. Obviously be sure the old file is closed before trying to so anything funny with it. Hal