diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-03 13:53:38 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-03-03 13:53:38 +0000 |
commit | e089d1161da7e51f78a49a23c290cfcc30ee2457 (patch) | |
tree | c01cc7eee80cc0b8f49f8fccb49b112871051a0e /lib/fileutils.rb | |
parent | 15dabe82163717bbdadab82d72e657f5fa731e99 (diff) | |
download | ruby-e089d1161da7e51f78a49a23c290cfcc30ee2457.tar.gz |
* lib/fileutils.rb (mv): could not move directory between different file systems. [ruby-dev:30411]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/fileutils.rb')
-rw-r--r-- | lib/fileutils.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 4da9b56fb6..386ea35f81 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1,7 +1,7 @@ # # = fileutils.rb # -# Copyright (c) 2000-2006 Minero Aoki +# Copyright (c) 2000-2007 Minero Aoki # # This program is free software. # You can distribute/modify this program under the same terms of ruby. @@ -504,7 +504,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] @@ -517,7 +521,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 |