chmod
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (38)
- 1_9_3_392 (0)
- 2_1_10 (6)
- 2_2_9 (0)
- 2_4_6 (-1)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
chmod(mode, list, noop: nil, verbose: nil)
public
Changes permission bits on the named files (in list) to the bit pattern represented by mode.
mode is the symbolic and absolute mode can be used.
Absolute mode is
FileUtils.chmod 0755, 'somecommand' FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb) FileUtils.chmod 0755, '/usr/bin/ruby', :verbose => true
Symbolic mode is
FileUtils.chmod "u=wrx,go=rx", 'somecommand' FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb) FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', :verbose => true
“a” |
is user, group, other mask. |
“u” |
is user’s mask. |
“g” |
is group’s mask. |
“o” |
is other’s mask. |
“w” |
is write permission. |
“r” |
is read permission. |
“x” |
is execute permission. |
“X” |
is execute permission for directories only, must be used in conjunction with “+” |
“s” |
is uid, gid. |
“t” |
is sticky bit. |
“+” |
is added to a class given the specified mode. |
“-” |
Is removed from a given class given mode. |
“=” |
Is the exact nature of the class will be given a specified mode. |