Share via


Core.RenameAsync Method

Definition

Renames a path. For renaming directory: If the destination exists then it puts the source directory one level under the destination.

public static System.Threading.Tasks.Task<bool> RenameAsync (string path, string destination, bool overwrite, Microsoft.Azure.DataLake.Store.AdlsClient client, Microsoft.Azure.DataLake.Store.RequestOptions req, Microsoft.Azure.DataLake.Store.OperationResponse resp, System.Threading.CancellationToken cancelToken = default);
static member RenameAsync : string * string * bool * Microsoft.Azure.DataLake.Store.AdlsClient * Microsoft.Azure.DataLake.Store.RequestOptions * Microsoft.Azure.DataLake.Store.OperationResponse * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Shared Function RenameAsync (path As String, destination As String, overwrite As Boolean, client As AdlsClient, req As RequestOptions, resp As OperationResponse, Optional cancelToken As CancellationToken = Nothing) As Task(Of 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

client
AdlsClient

ADLS Client

req
RequestOptions

Options to change behavior of the Http request

resp
OperationResponse

Stores the response/ouput of the Http request

cancelToken
CancellationToken

CancellationToken to cancel the request

Returns

True if rename is successful else false

Applies to