Permalink
Browse files

Making sure we write binary.

  • Loading branch information...
1 parent 366cc0d commit 5d6a14a3ce6bc0b9277f2b9585c19b121aff331a @JEG2 JEG2 committed Oct 28, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 rmate
View
2 rmate
@@ -85,7 +85,7 @@ def handle_save(socket, variables, data)
$stderr.puts "Saving #{path}" if $settings.verbose
begin
FileUtils.cp(path, "#{path}~") if File.exist? path
- File.open(path, 'w') { |file| file << data }
+ File.open(path, 'wb') { |file| file << data }
File.unlink("#{path}~") if File.exist? "#{path}~"
rescue
# TODO We probably want some way to notify the server app that the save failed

0 comments on commit 5d6a14a

Please sign in to comment.