chmod

chmod(mode, list, options = {})
Class Public methods

Options: noop verbose

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.

doc_ruby_on_rails
2015-04-06 18:00:51
Comments
Leave a Comment

Please login to continue.