Skip to content

Commit

Permalink
Making sure we write binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
JEG2 committed Oct 28, 2011
1 parent 366cc0d commit 5d6a14a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rmate
Expand Up @@ -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
Expand Down

0 comments on commit 5d6a14a

Please sign in to comment.