AdlsClient.CreateFileAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Azure SDK for .NET