public Method

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

Options: noop verbose force

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

FileUtils.chmod_R 0700, "/tmp/app.#{$$}"

Source Code

# File fileutils.rb, line 885
def chmod_R(mode, list, options = {})
  fu_check_options options, OPT_TABLE['chmod_R']
  list = fu_list(list)
  fu_output_message sprintf('chmod -R%s %o %s',
                            (options[:force] ? 'f' : ''),
                            mode, list.join(' ')) if options[:verbose]
  return if options[:noop]
  list.each do |root|
    Entry_.new(root).traverse do |ent|
      begin
        ent.chmod mode
      rescue
        raise unless options[:force]
      end
    end
  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.