Table of Contents

Method WriteAllTextAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

WriteAllTextAsync(string, string, Encoding?, CancellationToken)

Writes contents to a remote file, creating it or replacing its contents, as WriteAllTextAsync(string, string, Encoding, CancellationToken) does locally: UTF-8 without a byte order mark by default; a given encoding writes its preamble (a byte order mark), if it has one.

public Task WriteAllTextAsync(string path, string contents, Encoding? encoding = null, CancellationToken cancellationToken = default)

Parameters

path string
contents string
encoding Encoding
cancellationToken CancellationToken

Returns

Task

Remarks

As WriteAllBytesAsync(string, ReadOnlyMemory<byte>, CancellationToken): a failure part way leaves the file partly written.