public Method

FileUtils.chmod(mode, list, options = {})

Options: noop verbose

Changes permission bits on the named files (in list) to the bit pattern represented by mode.

FileUtils.chmod 0755, 'somecommand'
FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb)
FileUtils.chmod 0755, '/usr/bin/ruby', :verbose => true

Source Code

# File fileutils.rb, line 864
def chmod(mode, list, options = {})
  fu_check_options options, OPT_TABLE['chmod']
  list = fu_list(list)
  fu_output_message sprintf('chmod %o %s', mode, list.join(' ')) if options[:verbose]
  return if options[:noop]
  list.each do |path|
    Entry_.new(path).chmod mode
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.