Permalink
Browse files

helps if everything refers to fileutils

  • Loading branch information...
segfault committed Feb 27, 2009
1 parent 8980ecd commit ab1e4f7b0b9de85e0c9decf061d2ef5c1dc0feaa
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/technoweenie/attachment_fu/backends/file_system_backend.rb
@@ -110,8 +110,8 @@ def save_to_storage
if save_attachment?
# TODO: This overwrites the file if it exists, maybe have an allow_overwrite option?
FileUtils.mkdir_p(File.dirname(full_filename))
- File.cp(temp_path, full_filename)
- File.chmod(attachment_options[:chmod] || 0644, full_filename)
+ FileUtils.cp(temp_path, full_filename)
+ FileUtils.chmod(attachment_options[:chmod] || 0644, full_filename)
end
@old_filename = nil
true

1 comment on commit ab1e4f7

@ovelar

This comment has been minimized.

Show comment Hide comment
@ovelar

ovelar Mar 17, 2009

This commit actually saved our day yesterday – after switching to iSCSI storage (OCFS2) all original photos was corrupted, while all thumbnails were perfect. After some hours of joy, we figured that the difference between File.cp (bad method) and FileUtils.cp (good method) was the problem.

ovelar commented on ab1e4f7 Mar 17, 2009

This commit actually saved our day yesterday – after switching to iSCSI storage (OCFS2) all original photos was corrupted, while all thumbnails were perfect. After some hours of joy, we figured that the difference between File.cp (bad method) and FileUtils.cp (good method) was the problem.

Please sign in to comment.