SftpClient.copyData

SftpOperation!bool copyData(const(ubyte)[] readHandle, ulong readOffset, ulong readLength, const(ubyte)[] writeHandle, ulong writeOffset)

Copies data server-side between two open handles through the copy-data extension version 1 (note: no vendor suffix in the extension name).

A readLength of zero copies from readOffset to the end of the source file. Both handles must be open on this client's channel and outlive the operation; the source handle needs read access and the destination handle write access. Overlapping ranges on the same handle follow the server's semantics. No client-side fallback is attempted when the server lacks the extension.

Known server quirk: OpenSSH (at least through 10.2) reports OK for an explicit-length copy whose final write chunk failed, so applications needing confirmation should verify the destination size or content afterwards.

Parameters

readHandleHandle opened for reading.
readOffsetSource position.
readLengthByte count, or zero to copy to end of file.
writeHandleHandle opened for writing.
writeOffsetDestination position.

Returns

An operation completed by the server status response.

Throws

SftpException when the extension is not advertised

under its exact name or its version is not 1.