From 19ac7bdafc9e70846b57a7690a272dc25df44397 Mon Sep 17 00:00:00 2001 From: aamine Date: Sat, 3 Mar 2007 14:01:31 +0000 Subject: * 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@11977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/fileutils.rb | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d478159a65..713c5ab4f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Mar 3 23:01:07 2007 Minero Aoki + + * lib/fileutils.rb (mv): could not move a directory between + different filesystems. [ruby-dev:30411] + Sat Mar 3 22:57:11 2007 Minero Aoki * lib/fileutils.rb (touch): last commit causes error if :mtime diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 68acb1623e..913b985c8e 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 -- cgit v1.2.3