Share via


AdlsClient.Rename(String, String, Boolean, CancellationToken) Method

Definition

Synchronous API to rename a file or directory. For renaming directory: If the destination exists then it puts the source directory one level under the destination.

public virtual bool Rename (string path, string destination, bool overwrite = false, System.Threading.CancellationToken cancelToken = default);
abstract member Rename : string * string * bool * System.Threading.CancellationToken -> bool
override this.Rename : string * string * bool * System.Threading.CancellationToken -> bool
Public Overridable Function Rename (path As String, destination As String, Optional overwrite As Boolean = false, Optional cancelToken As CancellationToken = Nothing) As Boolean

Parameters

path
String

Path of the source file or directory

destination
String

Destination path

overwrite
Boolean

For file: If true then overwrites the destination file if it exists For directory: If the destination directory exists, then this flag has no use. Because it puts the source one level under destination. If there is a subdirectory with same name as source one level under the destination path, this flag has no use, rename fails

cancelToken
CancellationToken

CancellationToken to cancel the request

Returns

True if the path is renamed successfully else false

Applies to