On Jan 28, 2009, at 11:49 AM, Sean Cribbs wrote:
Sounds like paperclip should use FileUtils.rm_rf instead of rm_dir.
It doesn't, at least if it is the same as the one I have installed.
Here's the code:
def flush_deletes #:nodoc:
logger.info("[paperclip] Deleting files for #{name}")
@queued_for_delete.each do |path|
begin
logger.info("[paperclip] -> #{path}")
FileUtils.rm(path) if File.exist?(path)
rescue Errno::ENOENT => e
# ignore file-not-found, let everything else pass
end
end
@queued_for_delete = []
end
end
File.exist? returns true for files and directories. But unless I have
an old version of paperclipped that doesn't call FileUtils.rm, the
Ruby docs say specifically that FileUtils.rm does not remove
directories. And to be really safe, it should use
FileUtils.remove_entry_secure.
Steven, you might try a quick patch and change FileUtils.rm to
FileUtils.remove_entry_secure (or FileUtils.rm_rf like Sean suggests
if you are not terribly worried about security) in vendor/extensions/
paperclipped/vendor/plugins/paperclip/lib/paperclip/storage.rb
--cro
_______________________________________________
Radiant mailing list
Post: Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant