ShareDirectoryClient.ForceCloseAllHandlesAsync Method

Definition

The ForceCloseAllHandlesAsync(Nullable<Boolean>, CancellationToken) operation closes all handles opened on a directory or a file at the service. It optionally supports recursively closing handles on subresources when the resource is a directory.

This API is intended to be used alongside GetHandlesAsync(Nullable<Boolean>, CancellationToken) to force close handles that block operations, such as renaming a directory. These handles may have leaked or been lost track of by SMB clients. The API has client-side impact on the handle being closed, including user visible errors due to failed attempts to read or write files. This API is not intended for use as a replacement or alternative for SMB close.

FFor more information, see Force Close Handles.

public virtual System.Threading.Tasks.Task<Azure.Storage.Files.Shares.Models.CloseHandlesResult> ForceCloseAllHandlesAsync (bool? recursive = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ForceCloseAllHandlesAsync : Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Storage.Files.Shares.Models.CloseHandlesResult>
override this.ForceCloseAllHandlesAsync : Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Storage.Files.Shares.Models.CloseHandlesResult>
Public Overridable Function ForceCloseAllHandlesAsync (Optional recursive As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of CloseHandlesResult)

Parameters

recursive
Nullable<Boolean>

Optional. A boolean value that specifies if the operation should also apply to the files and subdirectories of the directory specified.

cancellationToken
CancellationToken

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

Returns

A CloseHandlesResult describing the status of the ForceCloseAllHandlesAsync(Nullable<Boolean>, CancellationToken) operation.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to