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

DataLakeFileSystemClient.CreateFileAsync 方法

定义

在此 CreateFileAsync(String, DataLakePathCreateOptions, CancellationToken) 文件系统中创建文件。 如果此文件已存在,则会将其覆盖。 如果不打算覆盖现有文件,请考虑使用 CreateIfNotExistsAsync(DataLakePathCreateOptions, CancellationToken) API。

有关详细信息,请参阅 https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.DataLake.DataLakeFileClient>> CreateFileAsync (string path, Azure.Storage.Files.DataLake.Models.DataLakePathCreateOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateFileAsync : string * Azure.Storage.Files.DataLake.Models.DataLakePathCreateOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.DataLake.DataLakeFileClient>>
override this.CreateFileAsync : string * Azure.Storage.Files.DataLake.Models.DataLakePathCreateOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.DataLake.DataLakeFileClient>>
Public Overridable Function CreateFileAsync (path As String, Optional options As DataLakePathCreateOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of DataLakeFileClient))

参数

path
String

要创建的文件的路径。

options
DataLakePathCreateOptions

可选参数。

cancellationToken
CancellationToken

可选 CancellationToken ,用于传播应取消操作的通知。

返回

描述 Response<T> 新创建的目录的 。

注解

RequestFailedException如果失败,将引发 。

适用于