Skip to content

Method ListAsync

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

ListAsync(string, bool, CancellationToken)

Lists the contents of a directory on the device.

csharp
Task<IReadOnlyList<DeviceFileInfo>> ListAsync(string path = "/", bool recursive = false, CancellationToken cancellationToken = default)

Parameters

path string

The directory path to list. Use "/" for root directory.

recursive bool

Whether to list contents recursively.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task<IReadOnlyList<DeviceFileInfo>>

A collection of file and directory information.

Exceptions

DirectoryNotFoundException

Thrown when the directory does not exist.

UnauthorizedAccessException

Thrown when access is denied.

Released under the Apache License 2.0.