class Knj::Filesystem

Public Class Methods

copy(args) click to toggle source
# File lib/knj/filesystem.rb, line 2
def self.copy(args)
  FileUtils.rm(args[:to]) if args[:replace] and File.exists?(args[:to])
  FileUtils.cp(args[:from], args[:to])
  mod = File.lstat(args[:from]).mode & 0777
  File.chmod(mod, args[:to])
end