Table of Contents

Property Resume

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

Resume

Continue an interrupted transfer, as sftp's reget and reput do: the destination's existing bytes are taken as the source's first ones, and only the rest is sent; a destination larger than the source is an error. Nothing checks that the existing bytes match, so use it for the same file only. A failed download with this set keeps what arrived. Overrides Overwrite for an existing destination.

public bool Resume { get; init; }

Property Value

bool

Remarks

A failed upload keeps what was written, so it can be resumed. Its writes are pipelined, and one that fails may be followed by later ones that land, leaving the remote file near its full size with a hole that a resume (taking the file's size for what was sent) would keep; so when a write landed past one that failed, the upload cuts the file back to its unbroken start before it throws. Where that cut cannot be made (the server cannot cut a file, did not answer in time, or a write went unanswered and may still land), the exception has UploadCleanupIncompleteKey set to true in its Data: do not resume that file; delete it or upload it again. A segmented upload (Segments) is always cut to its unbroken start, or deleted.