Method: Net::SFTP::Session#realpath

Defined in:
lib/net/sftp/session.rb

#realpath(path, &callback) ⇒ Object

:call-seq:

realpath(path) -> request
realpath(path) { |response| ... } -> request

Tries to canonicalize the given path, turning any given path into an absolute path. This is primarily useful for converting a path with “..” or “.” segments into an identical path without those segments. The answer will be in the response’s :names attribute, as a one-element array.

request = sftp.realpath("/path/../to/../directory").wait
puts request[:names].first.name


534
535
536
# File 'lib/net/sftp/session.rb', line 534

def realpath(path, &callback)
  request :realpath, path, &callback
end