FileSystemOperationsExtensions.CreateAsync 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.
Creates a file with optionally specified content. NOTE: If content is provided, the resulting file cannot be modified using ConcurrentAppend.
public static System.Threading.Tasks.Task CreateAsync (this Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations operations, string accountName, string directFilePath, System.IO.Stream streamContents = default, bool? overwrite = default, Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag? syncFlag = default, Guid? leaseId = default, int? permission = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task CreateAsync (this Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations operations, string accountName, string path, System.IO.Stream streamContents = default, bool? overwrite = default, Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag? syncFlag = default, Guid? leaseId = default, int? permission = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateAsync : Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations * string * string * System.IO.Stream * Nullable<bool> * Nullable<Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag> * Nullable<Guid> * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
static member CreateAsync : Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations * string * string * System.IO.Stream * Nullable<bool> * Nullable<Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag> * Nullable<Guid> * Nullable<int> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function CreateAsync (operations As IFileSystemOperations, accountName As String, directFilePath As String, Optional streamContents As Stream = Nothing, Optional overwrite As Nullable(Of Boolean) = Nothing, Optional syncFlag As Nullable(Of SyncFlag) = Nothing, Optional leaseId As Nullable(Of Guid) = Nothing, Optional permission As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
<Extension()>
Public Function CreateAsync (operations As IFileSystemOperations, accountName As String, path As String, Optional streamContents As Stream = Nothing, Optional overwrite As Nullable(Of Boolean) = Nothing, Optional syncFlag As Nullable(Of SyncFlag) = Nothing, Optional leaseId As Nullable(Of Guid) = Nothing, Optional permission As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- operations
- IFileSystemOperations
The operations group for this extension method.
- accountName
- String
The Azure Data Lake Store account to execute filesystem operations on.
- directFilePathpath
- String
The Data Lake Store path (starting with '/') of the file to create.
- streamContents
- Stream
The file contents to include when creating the file. This parameter is optional, resulting in an empty file if not specified.
Optionally indicates what to do after completion of the create. DATA indicates that more data will be sent immediately by the client, the file handle should remain open/locked, and file metadata (including file length, last modified time) should NOT get updated. METADATA indicates that more data will be sent immediately by the client, the file handle should remain open/locked, and file metadata should get updated. CLOSE indicates that the client is done sending data, the file handle should be closed/unlocked, and file metadata should get updated. Possible values include: 'DATA', 'METADATA', 'CLOSE'
Optional unique GUID per file to ensure single writer semantics, meaning that only clients that append to the file with the same leaseId will be allowed to do so.
The octal representation of the unnamed user, mask and other permissions that should be set for the file when created. If not specified, it inherits these from the container.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
Applies to
Azure SDK for .NET