Class: Chef::FileContentManagement::Deploy::Cp

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/file_content_management/deploy/cp.rb

Overview

PURPOSE: This strategy preserves the inode, and will preserve modes + ownership even if the user running chef cannot create that ownership (but has rights to the file). It is vulnerable to crashes in the middle of writing the file which could result in corruption or zero-length files.

Instance Method Summary collapse

Instance Method Details

#create(file) ⇒ Object



36
37
38
39
# File 'lib/chef/file_content_management/deploy/cp.rb', line 36

def create(file)
  Chef::Log.trace("Touching #{file} to create it")
  FileUtils.touch(file)
end

#deploy(src, dst) ⇒ Object



41
42
43
44
# File 'lib/chef/file_content_management/deploy/cp.rb', line 41

def deploy(src, dst)
  Chef::Log.trace("Copying temporary file #{src} into place at #{dst}")
  FileUtils.cp(src, dst)
end