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
System.String

Path of the source file or directory

destination
System.String

Destination path

overwrite
System.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
System.Threading.CancellationToken

CancellationToken to cancel the request

Returns

System.Boolean

True if the path is renamed successfully else false

Applies to