D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
FileUtils
/
Filename :
chmod-c.ri
back
Copy
U:RDoc::AnyMethod[iI" chmod:ETI"FileUtils::chmod;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"EChanges permissions on the entries at the paths given in +list+ ;TI"*(a single path or an array of paths) ;TI")to the permissions given by +mode+; ;TI"Areturns +list+ if it is an array, <tt>[list]</tt> otherwise:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"6Modifies each entry that is a regular file using ;TI"'{File.chmod}[rdoc-ref:File.chmod].;To;;0; [o; ; [I"7Modifies each entry that is a symbolic link using ;TI"){File.lchmod}[rdoc-ref:File.lchmod].;T@o; ; [I"%Argument +list+ or its elements ;TI"Kshould be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].;T@o; ; [I":Argument +mode+ may be either an integer or a string:;T@o;; ;;[o;;0; [o; ; [I"?\Integer +mode+: represents the permission bits to be set:;T@o:RDoc::Markup::Verbatim; [I"'FileUtils.chmod(0755, 'src0.txt') ;TI"5FileUtils.chmod(0644, ['src0.txt', 'src0.dat']) ;T:@format0o;;0; [ o; ; [I":\String +mode+: represents the permissions to be set:;T@o; ; [I"SThe string is of the form <tt>[targets][[operator][perms[,perms]]</tt>, where:;T@o;; ;;[o;;0; [o; ; [I"7+targets+ may be any combination of these letters:;T@o;; ;;[ o;;0; [o; ; [I"9<tt>'u'</tt>: permissions apply to the file's owner.;To;;0; [o; ; [I"B<tt>'g'</tt>: permissions apply to users in the file's group.;To;;0; [o; ; [I"L<tt>'o'</tt>: permissions apply to other users not in the file's group.;To;;0; [o; ; [I"@<tt>'a'</tt> (the default): permissions apply to all users.;T@o;;0; [o; ; [I",+operator+ may be one of these letters:;T@o;; ;;[o;;0; [o; ; [I"$<tt>'+'</tt>: adds permissions.;To;;0; [o; ; [I"'<tt>'-'</tt>: removes permissions.;To;;0; [o; ; [I"/<tt>'='</tt>: sets (replaces) permissions.;T@o;;0; [o; ; [I"7+perms+ (may be repeated, with separating commas) ;TI"-may be any combination of these letters:;T@o;; ;;[o;;0; [o; ; [I"<tt>'r'</tt>: Read.;To;;0; [o; ; [I"<tt>'w'</tt>: Write.;To;;0; [o; ; [I"5<tt>'x'</tt>: Execute (search, for a directory).;To;;0; [o; ; [I"3<tt>'X'</tt>: Search (for a directories only; ;TI"$must be used with <tt>'+'</tt>);To;;0; [o; ; [I"<tt>'s'</tt>: Uid or gid.;To;;0; [o; ; [I"<tt>'t'</tt>: Sticky bit.;T@o; ; [I"Examples:;T@o;; [I"0FileUtils.chmod('u=wrx,go=rx', 'src1.txt') ;TI"5FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby') ;T;0o; ; [I"Keyword arguments:;T@o;; ;;[o;;0; [o; ; [I"F<tt>noop: true</tt> - does not change permissions; returns +nil+.;To;;0; [o; ; [I";<tt>verbose: true</tt> - prints an equivalent command:;T@o;; [ I"BFileUtils.chmod(0755, 'src0.txt', noop: true, verbose: true) ;TI"PFileUtils.chmod(0644, ['src0.txt', 'src0.dat'], noop: true, verbose: true) ;TI"KFileUtils.chmod('u=wrx,go=rx', 'src1.txt', noop: true, verbose: true) ;TI"PFileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby', noop: true, verbose: true) ;T;0o; ; [I"Output:;T@o;; [ I"chmod 755 src0.txt ;TI"!chmod 644 src0.txt src0.dat ;TI" chmod u=wrx,go=rx src1.txt ;TI"%chmod u=wrx,go=rx /usr/bin/ruby ;T;0o; ; [I" Related: FileUtils.chmod_R.;T: @fileI"lib/fileutils.rb;T:0@omit_headings_from_table_of_contents_below000[ I"*(mode, list, noop: nil, verbose: nil);T@�FI"FileUtils;TcRDoc::NormalModule00