summaryrefslogtreecommitdiff
path: root/lib/fileutils.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-26 15:57:16 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-26 15:57:16 +0000
commit5bd2b12dae1737581edb9f53b505d6ec481adb95 (patch)
treec2123ad7fc5e661fe6a6f129059d275a9f910c08 /lib/fileutils.rb
parent4dd2dd2f211de95c50dbf1201f700e096bf0fa7e (diff)
* lib/fileutils.rb (remove_file): ignore Errno::E* if force option is set. [ruby-dev:25944]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/fileutils.rb')
-rw-r--r--lib/fileutils.rb25
1 files changed, 7 insertions, 18 deletions
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
#