Method: Chef::Provider::File#load_current_resource

Defined in:
lib/chef/provider/file.rb

#load_current_resourceObject



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/chef/provider/file.rb', line 47

def load_current_resource
  @current_resource = Chef::Resource::File.new(@new_resource.name)
  @current_resource.path(@new_resource.path)
  if ::File.exist?(@current_resource.path) && ::File.readable?(@current_resource.path)
    cstats = ::File.stat(@current_resource.path)
    @current_resource.owner(cstats.uid)
    @current_resource.group(cstats.gid)
    @current_resource.mode(octal_mode(cstats.mode))
    @current_resource.checksum(checksum(@current_resource.path))
  end
  @current_resource
end