# File lib/rye/cmd.rb, line 204
204:     def file_append(filepath, newcontent, backup=false)
205:       content = StringIO.new
206:       
207:       if self.file_exists?(filepath)
208:         self.cp filepath, "#{filepath}-previous" if backup
209:         content = self.file_download filepath
210:       end
211:       
212:       if newcontent.is_a?(StringIO)
213:         newcontent.rewind
214:         content.puts newcontent.read
215:       else
216:         content.puts newcontent
217:       end
218:       
219:       self.file_upload content, filepath
220:     end