This commit is contained in:
Cassondra Foesch 2021-03-06 09:03:37 +00:00
parent b83052b538
commit 714bd5db80
1 changed files with 4 additions and 0 deletions

View File

@ -789,6 +789,10 @@ func (c *Client) PosixRename(oldname, newname string) error {
} }
} }
// RealPath can be used to have the server canonicalize any given path name to an absolute path.
//
// This is useful for converting path names containing ".." components,
// or relative pathnames without a leading slash into absolute paths.
func (c *Client) RealPath(path string) (string, error) { func (c *Client) RealPath(path string) (string, error) {
id := c.nextID() id := c.nextID()
typ, data, err := c.sendPacket(nil, &sshFxpRealpathPacket{ typ, data, err := c.sendPacket(nil, &sshFxpRealpathPacket{