Skip to content

Instantly share code, notes, and snippets.

@libc
Created February 5, 2009 21:24
Show Gist options
  • Save libc/59018 to your computer and use it in GitHub Desktop.
Save libc/59018 to your computer and use it in GitHub Desktop.
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