summaryrefslogtreecommitdiff
path: root/lib/fileutils.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-04 12:29:55 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-04 12:29:55 +0000
commit95a5b4e9a406e01cf89709bd843914f7a730b910 (patch)
treeac2477f3fbbb71f54c7de4108ff1d9b37710de07 /lib/fileutils.rb
parent7c0370dcafee76642ea40d1a3488078f744910b4 (diff)
* lib/fileutils.rb: (In previous commit) new method chown.
* lib/fileutils.rb: (In previous commit) new method chown_R. * lib/fileutils.rb: (In previous commit) new method chmod_R wrongly added. Removed now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/fileutils.rb')
-rw-r--r--lib/fileutils.rb37
1 files changed, 7 insertions, 30 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 9684ebf31a..34efc4d85a 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -806,30 +806,8 @@ module FileUtils
#
# Options: noop verbose
#
- # Changes permission bits on the named files and directories (in +list+)
- # to the bit pattern represented by +mode+.
- #
- # FileUtils.chmod 0700, '/home/test/.ssh', :verbose => true
- #
- def chmod_R(mode, list, options = {})
- fu_check_options options, :noop, :verbose
- list = fu_list(list)
- fu_output_message sprintf('chmod -R %o %s',
- mode, list.join(' ')) if options[:verbose]
- return if options[:noop]
- list.each do |prefix|
- Find.find(prefix) do |path|
- File.chmod mode, path
- end
- end
- end
-
-
- #
- # Options: noop verbose
- #
# Changes owner and group on the named files (in +list+)
- # to the user +user+ and the group +group. +user+ and +group+
+ # to the user +user+ and the group +group+. +user+ and +group+
# may be an ID (Integer/String) or a name (String).
# If +user+ or +group+ is nil, this method does not change
# the attribute.
@@ -852,13 +830,13 @@ module FileUtils
# Options: noop verbose
#
# Changes owner and group on the named files (in +list+)
- # to the user +user+ and the group +group. +user+ and +group+
- # may be an ID (Integer/String) or a name (String).
- # If +user+ or +group+ is nil, this method does not change
- # the attribute.
+ # to the user +user+ and the group +group+ recursively.
+ # +user+ and +group+ may be an ID (Integer/String) or
+ # a name (String). If +user+ or +group+ is nil, this
+ # method does not change the attribute.
#
- # FileUtils.chmod_R 'www', 'www', '/var/www/htdocs'
- # FileUtils.chmod_R 'cvs', 'cvs', '/var/cvs', :verbose => true
+ # FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
+ # FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', :verbose => true
#
def chown_R(mode, list, options = {})
fu_check_options options, :noop, :verbose
@@ -1038,7 +1016,6 @@ module FileUtils
'cd' => %w( noop verbose ),
'chdir' => %w( noop verbose ),
'chmod' => %w( noop verbose ),
- 'chmod_R' => %w( noop verbose ),
'chown' => %w( noop verbose ),
'chown_R' => %w( noop verbose ),
'copy' => %w( noop verbose preserve ),