summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-04 14:53:54 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-04 14:53:54 +0000
commit2d531c82ebe46092fcaab2c4ccc0bdc0f9d52523 (patch)
tree908231dbc312f130b9f528fc8b937f56ab2179b2 /lib
parentae73017cadc3114cf7dc4ef43f0a163414f0c50e (diff)
* lib/fileutils.rb (mv): could not move a directory between
different filesystems. [ruby-dev:30411] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@11988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/fileutils.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 9216c74..cf0c91b 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -505,7 +505,11 @@ module FileUtils
File.rename s, d
rescue Errno::EXDEV
copy_entry s, d, true
- File.unlink s
+ if options[:secure]
+ remove_entry_secure s, options[:force]
+ else
+ remove_entry s, options[:force]
+ end
end
rescue SystemCallError
raise unless options[:force]
@@ -518,7 +522,7 @@ module FileUtils
module_function :move
OPT_TABLE['mv'] =
- OPT_TABLE['move'] = [:force, :noop, :verbose]
+ OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
def rename_cannot_overwrite_file? #:nodoc:
/djgpp|cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM