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

AdlsClient.CreateFileAsync Method

Definition

Asynchronous API that creates a file and returns the stream to write data to that file in ADLS. The file is opened with exclusive access - any attempt to open the same file for append will fail while this stream is open.

Threading: The returned stream is not thread-safe.

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)

Parameters

filename
String

File name

mode
IfExists

Overwrites the existing file if the mode is Overwrite

octalPermission
String

Octal permission string, can be null

createParent
Boolean

If true creates any non-existing parent directories

cancelToken
CancellationToken

CancellationToken to cancel the request

Returns

Output stream

Applies to