diff options
author | hut <hut@lavabit.com> | 2009-07-29 18:58:31 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-07-29 18:58:31 +0200 |
commit | a6e2468a9a34838e26a7f4e69b372af147250b98 (patch) | |
tree | 37a163d4dbf1cb5ccea67671c7cc60cccc1e28a7 /code/action.rb | |
parent | c5b816b28209dce887a98da93f119a03caac5eb5 (diff) | |
download | ranger-a6e2468a9a34838e26a7f4e69b372af147250b98.tar.gz |
fixed occasional failure of deletion
when Fileutils.remove_entry_secure() fails, use a simple FileUtils.remove_entry().
Diffstat (limited to 'code/action.rb')
-rw-r--r-- | code/action.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/code/action.rb b/code/action.rb index 76a0e361..89d27bb3 100644 --- a/code/action.rb +++ b/code/action.rb @@ -73,5 +73,23 @@ module Action print "Press [ENTER] to continue..." $stdin.gets end + + def delete!(*entries) + for file in entries + if file.is_a? Directory::Entry + file = file.path + end + + begin + FileUtils.remove_entry_secure(file) + rescue + begin + FileUtils.remove_entry(file) + rescue + lograise + end + end + end + end end |