summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/fileutils.rb25
2 files changed, 12 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 841c8f12a1..f946046497 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Mar 27 00:56:58 2005 Minero Aoki <aamine@loveruby.net>
+
+ * lib/fileutils.rb (remove_file): ignore Errno::E* if force option
+ is set. [ruby-dev:25944]
+
Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb (_callback_entry_class?): add for checking whether
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index b4ed5f5153..52575e18f1 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1,7 +1,7 @@
#
# = fileutils.rb
#
-# Copyright (C) 2000-2005 Minero Aoki <aamine@loveruby.net>
+# Copyright (c) 2000-2005 Minero Aoki <aamine@loveruby.net>
#
# This program is free software.
# You can distribute/modify this program under the same terms of ruby.
@@ -117,7 +117,6 @@ module FileUtils
alias chdir cd
-
#
# Options: (none)
#
@@ -140,7 +139,6 @@ module FileUtils
true
end
-
#
# Options: mode noop verbose
#
@@ -224,7 +222,6 @@ module FileUtils
end
private :fu_mkdir
-
#
# Options: noop, verbose
#
@@ -246,7 +243,6 @@ module FileUtils
end
end
-
#
# Options: force noop verbose
#
@@ -330,7 +326,6 @@ module FileUtils
ln_s src, dest, options
end
-
#
# Options: preserve noop verbose
#
@@ -418,7 +413,8 @@ module FileUtils
# Both of +src+ and +dest+ must be a path name.
# +src+ must exist, +dest+ must not exist.
#
- # If +preserve+ is true, this method preserves owner, group and permissions.
+ # If +preserve+ is true, this method preserves owner, group, permissions
+ # and modified time.
# If +dereference+ is true, this method copies a target of symbolic link
# instead of a symbolic link itself.
#
@@ -436,8 +432,8 @@ module FileUtils
#
# Copies stream +src+ to +dest+.
- # +src+ must be respond to #read(n) and
- # +dest+ must be respond to #write(str).
+ # +src+ must respond to #read(n) and
+ # +dest+ must respond to #write(str).
#
def copy_stream(src, dest)
fu_copy_stream0 src, dest, fu_stream_blksize(src, dest)
@@ -450,7 +446,7 @@ module FileUtils
end
private :fu_copy_stream0
- class CopyContext_
+ class CopyContext_ # :nodoc: internal use only
include ::FileUtils
def initialize(preserve = false, dereference = false, stat = nil)
@@ -623,7 +619,6 @@ module FileUtils
end
private :rename_cannot_overwrite_file?
-
#
# Options: force noop verbose
#
@@ -720,7 +715,7 @@ module FileUtils
File.chmod 0777, fname
retry
end
- raise
+ raise unless force
end
end
@@ -743,7 +738,6 @@ module FileUtils
end
end
-
#
# Returns true if the contents of a file A and a file B are identical.
#
@@ -780,7 +774,6 @@ module FileUtils
false
end
-
#
# Options: mode noop verbose
#
@@ -806,7 +799,6 @@ module FileUtils
end
end
-
#
# Options: noop verbose
#
@@ -825,7 +817,6 @@ module FileUtils
File.chmod mode, *list
end
-
#
# Options: noop verbose
#
@@ -848,7 +839,6 @@ module FileUtils
File.chown fu_get_uid(user), fu_get_gid(group), *list
end
-
#
# Options: noop verbose
#
@@ -912,7 +902,6 @@ module FileUtils
end
end
-
#
# Options: noop verbose
#