Skip to content

Method DeleteDirectoryAsync ​

Namespace: Belay.Sync
Assembly: Belay.Sync.dll

DeleteDirectoryAsync(string, bool, CancellationToken) ​

Deletes a directory from the device.

csharp
Task DeleteDirectoryAsync(string path, bool recursive = false, CancellationToken cancellationToken = default)

Parameters ​

path string

The directory path to delete.

recursive bool

Whether to delete the directory and all its contents.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns ​

Task

Exceptions ​

DirectoryNotFoundException

Thrown when the directory does not exist.

UnauthorizedAccessException

Thrown when access is denied.

IOException

Thrown when the directory is not empty and recursive is false.

Released under the Apache License 2.0.