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

AdlsClient.CreateFileAsync 方法

定义

异步 API,用于创建文件并返回流以将数据写入 ADLS 中的该文件。 该文件以独占访问权限打开 - 打开此流时,任何打开同一个文件进行追加的尝试都将失败。

线程处理:返回的流不是线程安全的。

public virtual System.Threading.Tasks.Task<Microsoft.Azure.DataLake.Store.AdlsOutputStream> CreateFileAsync(string filename, Microsoft.Azure.DataLake.Store.IfExists mode, string octalPermission = default, bool createParent = true, System.Threading.CancellationToken cancelToken = default);
abstract member CreateFileAsync : string * Microsoft.Azure.DataLake.Store.IfExists * string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.DataLake.Store.AdlsOutputStream>
override this.CreateFileAsync : string * Microsoft.Azure.DataLake.Store.IfExists * string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.DataLake.Store.AdlsOutputStream>
Public Overridable Function CreateFileAsync (filename As String, mode As IfExists, Optional octalPermission As String = Nothing, Optional createParent As Boolean = true, Optional cancelToken As CancellationToken = Nothing) As Task(Of AdlsOutputStream)

参数

filename
String

文件名

mode
IfExists

如果模式为 Overwrite,则覆盖现有文件

octalPermission
String

八进制权限字符串,可以为 null

createParent
Boolean

如果为 true,则创建任何不存在的父目录

cancelToken
CancellationToken

CancellationToken 取消请求

返回

输出流

适用于