Method: FileUtils.chmod_R
- Defined in:
- lib/extensions/fileutils/fileutils.rb
.chmod_R(mode, list, options = {}) ⇒ Object
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.#{$$}"
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 |
# File 'lib/extensions/fileutils/fileutils.rb', line 894 def chmod_R(mode, list, = {}) , OPT_TABLE['chmod_R'] list = fu_list(list) sprintf('chmod -R%s %o %s', ([:force] ? 'f' : ''), mode, list.join(' ')) if [:verbose] return if [:noop] list.each do |root| Entry_.new(root).traverse do |ent| begin ent.chmod mode rescue raise unless [:force] end end end end |