Table of Contents

Method OpenAsync

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

OpenAsync(string, FileMode, FileAccess, CancellationToken)

Opens a remote file as a seekable Stream (asynchronous reads and writes only). mode works as for FileStream: Create creates or truncates, CreateNew fails if the file exists, Append starts at the end. Disposing the stream closes the remote file.

public Task<Stream> OpenAsync(string path, FileMode mode, FileAccess access, CancellationToken cancellationToken = default)

Parameters

path string
mode FileMode
access FileAccess
cancellationToken CancellationToken

Returns

Task<Stream>