module Windows::File

def chgrp(group, path, recursive = false)

Other tags:
    Note: - Cygwin's `chgrp` implementation does not support
def chgrp(group, path, recursive = false)
  cygpath = execute("cygpath -u #{path}")
  super(group, cygpath, recursive)
end

def chmod(mod, path, recursive = false); end

Not needed on windows
def chmod(mod, path, recursive = false); end

def chown(user, path, recursive = false)

Other tags:
    Note: - Cygwin's `chown` implementation does not support
def chown(user, path, recursive = false)
  cygpath = execute("cygpath -u #{path}")
  super(user, cygpath, recursive)
end

def file_exist?(path)

def file_exist?(path)
  result = exec(Beaker::Command.new("test -e '#{path}'"), :acceptable_exit_codes => [0, 1])
  result.exit_code == 0
end

def ls_ld(path)

Other tags:
    Note: - Cygwin's `ls_ld` implementation does not support
def ls_ld(path)
  cygpath = execute("cygpath -u #{path}")
  super(cygpath)
end

def path_split(paths)

def path_split(paths)
  paths.split(';')
end

def scp_path(path)

Returns:
  • (String) - Path updated for use by SCP

Parameters:
  • path (String) -- Path to be changed

Other tags:
    Note: - This will fail with an SSH server that is not OpenSSL or BitVise.
def scp_path(path)
  case determine_ssh_server
  when :bitvise
    # swap out separators
    path.gsub('\\', scp_separator)
  when :openssh
    path
  when :win32_openssh
    path.tr('\\', '/')
  else
    raise ArgumentError, "windows/file.rb:scp_path: ssh server not recognized: '#{determine_ssh_server}'"
  end
end

def system_temp_path

def system_temp_path
  # under CYGWIN %TEMP% may not be set
  tmp_path = execute('ECHO %SYSTEMROOT%', :cmdexe => true)
  tmp_path.delete("\n") + '\\TEMP'
end

def tmpdir(name = '')

def tmpdir(name = '')
  execute("cygpath -m $(mktemp -td #{name}.XXXXXX)")
end

def tmpfile(name = '', extension = nil)

def tmpfile(name = '', extension = nil)
  execute("cygpath -m $(mktemp -t #{name}.XXXXXX#{extension})")
end