Skip to content

Method WriteTextFileAsync

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

WriteTextFileAsync(string, string, CancellationToken)

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

csharp
public Task WriteTextFileAsync(string path, string content, CancellationToken cancellationToken = default)

Parameters

path string

The file path to write to.

content string

The text 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.