Method: FileUtils.chmod_R
- Defined in:
- lib/fileutils.rb
.chmod_R(mode, list, noop: nil, verbose: nil, force: nil) ⇒ Object
Like FileUtils.chmod, but changes permissions recursively.
1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 |
# File 'lib/fileutils.rb', line 1816 def chmod_R(mode, list, noop: nil, verbose: nil, force: nil) list = fu_list(list) sprintf('chmod -R%s %s %s', (force ? 'f' : ''), mode_to_s(mode), list.join(' ')) if verbose return if noop list.each do |root| Entry_.new(root).traverse do |ent| begin ent.chmod(fu_mode(mode, ent.path)) rescue raise unless force end end end end |