# File lib/rye/cmd.rb, line 225
225:     def file_write(filepath, newcontent, backup=false)
226:       if self.file_exists?(filepath)
227:         self.cp filepath, "#{filepath}-previous" if backup
228:       end
229:       
230:       content = StringIO.new
231:       content.puts newcontent
232:       self.file_upload content, filepath
233:     end