From: James Dinkel Date: 2009-05-02T05:39:57+09:00 Subject: Re: Read and re-write file with one open? Aw, word wrapping broke some of my lines... these should be single lines: > ### for example, an assignemt "contents = 'new data'" will break the method > File.open(filename, 'w') { |blank| blank.write '' } unless File.exist?(filename) > # do not write the file if it did not change (block must "throw :nochanges") -- Posted via http://www.ruby-forum.com/.