Table of Contents

Method RenameAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

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

oldPath string
newPath string
overwrite bool
cancellationToken CancellationToken

Returns

Task

Exceptions

NotSupportedException

overwrite and the server lacks posix-rename@openssh.com.