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
readHandle | Handle opened for reading. |
readOffset | Source position. |
readLength | Byte count, or zero to copy to end of file. |
writeHandle | Handle opened for writing. |
writeOffset | Destination position. |
Returns
Throws
under its exact name or its version is not 1.