summaryrefslogtreecommitdiffstats
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
commit657989ea6ef1a48e18079b0b779e41eb06e014a9 (patch)
tree908231dbc312f130b9f528fc8b937f56ab2179b2
parent21a335d4459f5f438e4b1e538fa6d436c059a61d (diff)
downloadruby-657989ea6ef1a48e18079b0b779e41eb06e014a9.tar.gz
ruby-657989ea6ef1a48e18079b0b779e41eb06e014a9.tar.xz
ruby-657989ea6ef1a48e18079b0b779e41eb06e014a9.zip
* lib/fileutils.rb (mv): could not move a directory between
different filesystems. [ruby-dev:30411] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@11988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/fileutils.rb8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 04cab7dce..84a526283 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Mar 4 23:53:27 2007 Minero Aoki <aamine@loveruby.net>
+
+ * lib/fileutils.rb (mv): could not move a directory between
+ different filesystems. [ruby-dev:30411]
+
Sun Mar 4 23:46:40 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_s_utime): allow nil to set the current time.
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 9216c7477..cf0c91b0a 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