你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

DataLakePathClient.ExistsAsync(CancellationToken) Method

Definition

The ExistsAsync(CancellationToken) operation can be called on a DataLakePathClient to see if the associated file or directory exists in the file system.

public virtual System.Threading.Tasks.Task<Azure.Response<bool>> ExistsAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member ExistsAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<bool>>
override this.ExistsAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<bool>>
Public Overridable Function ExistsAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Boolean))

Parameters

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Returns true if the file or directory exists.

Remarks

A RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an AggregateException will be thrown, containing each failure instance. If you want to create the file system if it doesn't exist, use CreateIfNotExistsAsync(PathResourceType, DataLakePathCreateOptions, CancellationToken) instead.

Applies to