Module: FileUtils
- Defined in:
- lib/file.rb
Class Method Summary collapse
Class Method Details
.clone_perms(src, dest) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/file.rb', line 11 def self.clone_perms(src, dest) if File.directory?(src) && File.directory?(dest) Find.find(src) { |entry| next if entry =~ /^\/proc/ begin stat = File.stat(entry) FileUtils.chmod(stat.mode, "#{dest}#{entry}") FileUtils.chown(stat.uid, stat.gid, "#{dest}#{entry}") rescue => e end } end end |