Method: Chef::ReservedNames::Win32::API::File#encode_path

Defined in:
lib/chef/win32/api/file.rb

#encode_path(path) ⇒ Object

takes the given path pre-pends “\?\” and UTF-16LE encodes it. Used to prepare paths to be passed to the *W vesion of WinAPI File functions. This function is used by the “Link” resources where we need preserve relative paths because symbolic links can actually point to a relative path (relative to the link itself).



520
521
522
# File 'lib/chef/win32/api/file.rb', line 520

def encode_path(path)
  (path_prepender << path.gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR)).to_wstring
end