Sdílet prostřednictvím


CloudFile.OpenWriteAsync Method

Definition

Overloads

OpenWriteAsync(Nullable<Int64>)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

OpenWriteAsync(Nullable<Int64>, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

OpenWriteAsync(Nullable<Int64>, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

OpenWriteAsync(Nullable<Int64>, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

OpenWriteAsync(Nullable<Int64>)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream> OpenWriteAsync (long? size);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Nullable<int64> -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
override this.OpenWriteAsync : Nullable<int64> -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
Public Overridable Function OpenWriteAsync (size As Nullable(Of Long)) As Task(Of CloudFileStream)

Parameters

size
Nullable<Int64>

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

Returns

A Task<TResult> object that represents the current operation.

Attributes

Applies to

OpenWriteAsync(Nullable<Int64>, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream> OpenWriteAsync (long? size, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
override this.OpenWriteAsync : Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
Public Overridable Function OpenWriteAsync (size As Nullable(Of Long), cancellationToken As CancellationToken) As Task(Of CloudFileStream)

Parameters

size
Nullable<Int64>

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for a task to complete.

Returns

A Task<TResult> object that represents the current operation.

Attributes

Applies to

OpenWriteAsync(Nullable<Int64>, AccessCondition, FileRequestOptions, OperationContext)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream> OpenWriteAsync (long? size, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.File.FileRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Nullable<int64> * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.File.FileRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
override this.OpenWriteAsync : Nullable<int64> * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.File.FileRequestOptions * Microsoft.Azure.Storage.OperationContext -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
Public Overridable Function OpenWriteAsync (size As Nullable(Of Long), accessCondition As AccessCondition, options As FileRequestOptions, operationContext As OperationContext) As Task(Of CloudFileStream)

Parameters

size
Nullable<Int64>

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

accessCondition
AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options
FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext
OperationContext

An OperationContext object that represents the context for the current operation.

Returns

A Task<TResult> object that represents the current operation.

Attributes

Applies to

OpenWriteAsync(Nullable<Int64>, AccessCondition, FileRequestOptions, OperationContext, CancellationToken)

Returns a task that performs an asynchronous operation to open a stream for writing to the file. If the file already exists, then existing data in the file may be overwritten.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream> OpenWriteAsync (long? size, Microsoft.Azure.Storage.AccessCondition accessCondition, Microsoft.Azure.Storage.File.FileRequestOptions options, Microsoft.Azure.Storage.OperationContext operationContext, System.Threading.CancellationToken cancellationToken);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member OpenWriteAsync : Nullable<int64> * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.File.FileRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
override this.OpenWriteAsync : Nullable<int64> * Microsoft.Azure.Storage.AccessCondition * Microsoft.Azure.Storage.File.FileRequestOptions * Microsoft.Azure.Storage.OperationContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Storage.File.CloudFileStream>
Public Overridable Function OpenWriteAsync (size As Nullable(Of Long), accessCondition As AccessCondition, options As FileRequestOptions, operationContext As OperationContext, cancellationToken As CancellationToken) As Task(Of CloudFileStream)

Parameters

size
Nullable<Int64>

The size of the file to create, in bytes, or null. If null, the file must already exist. If not null, a new file of the given size will be created. If size is not null but the file already exists on the service, the already-existing file will be deleted.

accessCondition
AccessCondition

An AccessCondition object that represents the access conditions for the file. If null, no condition is used.

options
FileRequestOptions

A FileRequestOptions object that specifies additional options for the request.

operationContext
OperationContext

An OperationContext object that represents the context for the current operation.

cancellationToken
CancellationToken

A CancellationToken to observe while waiting for a task to complete.

Returns

A Task<TResult> object that represents the current operation.

Attributes

Applies to