Skip to content

Method WriteFileAsync

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

WriteFileAsync(string, byte[], CancellationToken)

Writes data to a file on the device, creating it if necessary.

csharp
public Task WriteFileAsync(string path, byte[] content, CancellationToken cancellationToken = default)

Parameters

path string

The file path to write to.

content byte[]

The content to write.

cancellationToken CancellationToken

Cancellation token to cancel the operation.

Returns

Task

Exceptions

UnauthorizedAccessException

Thrown when access is denied.

IOException

Thrown when an I/O error occurs.

Released under the Apache License 2.0.