class Chef::ReservedNames::Win32::File

Public Class Methods

get_long_path_name(path) click to toggle source

Gets the long form of a path (ADMINI~1 -> Administrator)

# File lib/chef/win32/file.rb, line 131
def self.get_long_path_name(path)
  path = path.to_wstring
  size = GetLongPathNameW(path, nil, 0)
  if size == 0
    Chef::ReservedNames::Win32::Error.raise!
  end
  result = FFI::MemoryPointer.new :char, (size+1)*2
  if GetLongPathNameW(path, result, size+1) == 0
    Chef::ReservedNames::Win32::Error.raise!
  end
  result.read_wstring(size)
end
get_short_path_name(path) click to toggle source

Gets the short form of a path (Administrator -> ADMINI~1)

# File lib/chef/win32/file.rb, line 117
def self.get_short_path_name(path)
  path = path.to_wstring
  size = GetShortPathNameW(path, nil, 0)
  if size == 0
    Chef::ReservedNames::Win32::Error.raise!
  end
  result = FFI::MemoryPointer.new :char, (size+1)*2
  if GetShortPathNameW(path, result, size+1) == 0
    Chef::ReservedNames::Win32::Error.raise!
  end
  result.read_wstring(size)
end
info(file_name) click to toggle source
# File lib/chef/win32/file.rb, line 144
def self.info(file_name)
  Info.new(file_name)
end
Also aliased as: stat
stat(file_name)
Alias for: info