File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,11 @@ internal interface ISftpSession : ISubsystemSession
3535 /// Resolves a given path into an absolute path on the server.
3636 /// </summary>
3737 /// <param name="path">The path to resolve.</param>
38+ /// <param name="getRealPath">Boolean determining whether to get the ral path.</param>
3839 /// <returns>
3940 /// The absolute path.
4041 /// </returns>
41- string GetCanonicalPath ( string path ) ;
42+ string GetCanonicalPath ( string path , bool getRealPath = true ) ;
4243
4344 Task < string > GetCanonicalPathAsync ( string path , CancellationToken cancellationToken ) ;
4445
Original file line number Diff line number Diff line change @@ -89,13 +89,20 @@ internal void SendMessage(SftpMessage sftpMessage)
8989 /// Resolves a given path into an absolute path on the server.
9090 /// </summary>
9191 /// <param name="path">The path to resolve.</param>
92+ /// <param name="getRealPath">Boolean determining whether to get the real path.</param>
9293 /// <returns>
9394 /// The absolute path.
9495 /// </returns>
95- public string GetCanonicalPath ( string path )
96+ public string GetCanonicalPath ( string path , bool getRealPath = true )
9697 {
9798 var fullPath = GetFullRemotePath ( path ) ;
9899
100+ if ( ! getRealPath )
101+ {
102+ // getRealPath set to false allows us to get a reference to the symbolic link itself and not to the file it points to.
103+ return fullPath ;
104+ }
105+
99106 var canonizedPath = string . Empty ;
100107
101108 var realPathFiles = RequestRealPath ( fullPath , nullOnError : true ) ;
You can’t perform that action at this time.
0 commit comments