From: Tom Hughes Date: Thu, 7 Feb 2008 23:53:20 +0000 (+0000) Subject: Use FileUtils.mv instead of File.rename as it will do a copy+delete when X-Git-Tag: live~7919 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/4f33014464004dee1b45e33831bb6528ead6d3f7?ds=sidebyside Use FileUtils.mv instead of File.rename as it will do a copy+delete when the source and target are not on the same filesystem. Closes #670. --- diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index c56ff4a74..4db6e8e15 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -301,7 +301,7 @@ private @trace.timestamp = Time.now if @trace.save - File.rename(filename, @trace.trace_name) + FileUtils.mv(filename, @trace.trace_name) else FileUtils.rm_f(filename) end