Table of Contents

Method DownloadDirectoryAsync

Namespace
SshSharp.Scp
Assembly
SshSharp.dll

DownloadDirectoryAsync(SshClient, string, string, SshScpOptions?, CancellationToken)

Downloads the remote directory remotePath and everything in it (scp -r). As with scp, it becomes localDirectory when that does not exist, or a directory inside it when it does.

public static Task DownloadDirectoryAsync(this SshClient client, string remotePath, string localDirectory, SshScpOptions? options = null, CancellationToken cancellationToken = default)

Parameters

client SshClient
remotePath string
localDirectory string
options SshScpOptions
cancellationToken CancellationToken

Returns

Task

Exceptions

SshException

The transfer failed (TransferFailed).