Commit 1ff1cc73 by Ryan Schlesinger Committed by Prem Sichanugrist

Falling back from mv to cp/rm on error.

Closes #388
parent 290d914f
......@@ -38,7 +38,12 @@ module Paperclip
file.close
FileUtils.mkdir_p(File.dirname(path(style_name)))
log("saving #{path(style_name)}")
FileUtils.mv(file.path, path(style_name))
begin
FileUtils.mv(file.path, path(style_name))
rescue SystemCallError
FileUtils.cp(file.path, path(style_name))
FileUtils.rm(file.path)
end
FileUtils.chmod(0644, path(style_name))
end
@queued_for_write = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment