Created
February 5, 2009 21:24
-
-
Save libc/59018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/technoweenie/attachment_fu/backends/file_system_backend.rb b/lib/technoweenie/attachment_fu/backends/file_system_backend.rb | |
index f746ae7..591365a 100644 | |
--- a/lib/technoweenie/attachment_fu/backends/file_system_backend.rb | |
+++ b/lib/technoweenie/attachment_fu/backends/file_system_backend.rb | |
@@ -1,4 +1,4 @@ | |
-require 'ftools' | |
+require 'fileutils' | |
module Technoweenie # :nodoc: | |
module AttachmentFu # :nodoc: | |
module Backends | |
@@ -85,8 +85,8 @@ module Technoweenie # :nodoc: | |
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) | |
+ FileUtils.cp(temp_path, full_filename) | |
File.chmod(attachment_options[:chmod] || 0644, full_filename) | |
end | |
@old_filename = nil | |
true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment