Method RenameAsync
RenameAsync(string, string, bool, CancellationToken)
Renames or moves oldPath to newPath. Plain SFTP refuses when newPath exists;
with overwrite it is replaced atomically, which needs the server's posix-rename@openssh.com.
public Task RenameAsync(string oldPath, string newPath, bool overwrite = false, CancellationToken cancellationToken = default)
Parameters
oldPathstringnewPathstringoverwriteboolcancellationTokenCancellationToken
Returns
Exceptions
- NotSupportedException
overwriteand the server lacksposix-rename@openssh.com.