Share via


ShareClient.CreateDirectory Method

Definition

The CreateDirectoryAsync(String, ShareDirectoryCreateOptions, CancellationToken) operation creates a new directory in this share.

For more information, see Create Directory.

public virtual Azure.Response<Azure.Storage.Files.Shares.ShareDirectoryClient> CreateDirectory (string directoryName, Azure.Storage.Files.Shares.Models.ShareDirectoryCreateOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateDirectory : string * Azure.Storage.Files.Shares.Models.ShareDirectoryCreateOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Files.Shares.ShareDirectoryClient>
override this.CreateDirectory : string * Azure.Storage.Files.Shares.Models.ShareDirectoryCreateOptions * System.Threading.CancellationToken -> Azure.Response<Azure.Storage.Files.Shares.ShareDirectoryClient>
Public Overridable Function CreateDirectory (directoryName As String, Optional options As ShareDirectoryCreateOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of ShareDirectoryClient)

Parameters

directoryName
String

The name of the directory to create.

options
ShareDirectoryCreateOptions

Optional parameters.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

A Response<T> referencing the newly created directory.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to