Method ExpandPathAsync
ExpandPathAsync(string, CancellationToken)
path with a leading ~ or ~user expanded and made canonical, as sftp does for
cd ~/dir (expand-path@openssh.com, OpenSSH 8.7+). Without the extension, ~ and ~/... start at
GetHomeDirectoryAsync(CancellationToken), and a path without a tilde resolves as GetFullPathAsync(string, CancellationToken) does.
public Task<string> ExpandPathAsync(string path, CancellationToken cancellationToken = default)
Parameters
pathstringcancellationTokenCancellationToken
Returns
Exceptions
- NotSupportedException
The path starts with
~userand the server lacksexpand-path@openssh.com.- SftpException
The path cannot be resolved, or the user is unknown.