File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -789,7 +789,11 @@ func (c *Client) PosixRename(oldname, newname string) error {
789
789
}
790
790
}
791
791
792
- func (c * Client ) realpath (path string ) (string , error ) {
792
+ // RealPath can be used to have the server canonicalize any given path name to an absolute path.
793
+ //
794
+ // This is useful for converting path names containing ".." components,
795
+ // or relative pathnames without a leading slash into absolute paths.
796
+ func (c * Client ) RealPath (path string ) (string , error ) {
793
797
id := c .nextID ()
794
798
typ , data , err := c .sendPacket (nil , & sshFxpRealpathPacket {
795
799
ID : id ,
@@ -820,7 +824,7 @@ func (c *Client) realpath(path string) (string, error) {
820
824
// Getwd returns the current working directory of the server. Operations
821
825
// involving relative paths will be based at this location.
822
826
func (c * Client ) Getwd () (string , error ) {
823
- return c .realpath ("." )
827
+ return c .RealPath ("." )
824
828
}
825
829
826
830
// Mkdir creates the specified directory. An error will be returned if a file or
You can’t perform that action at this time.
0 commit comments