ddn.net.sftp.client
SFTP client (draft-ietf-secsh-filexfer-02, protocol version 3).
A non-blocking SFTP client operating on any SshChannel from the DDN core API. The client depends only on the channel interface, never on a concrete SSH implementation or a cryptographic library; applications wire an opened subsystem channel from any transport.
Driving model: construct on a channel, call pump to move bytes and advance pending operations, and poll the returned operation objects. Every potentially-blocking step reports progress instead of blocking.
Types 6
SFTP client limits from the support matrix.
Raised for SFTP client violations: framing errors, unexpected responses, or unsupported versions.
this(string msg, string file = __FILE__, size_t line = __LINE__)Constructs an SFTP exception.Progress of an SFTP operation.
Typed SFTP operation error.
uint codeSFTP status code (0 when the failure is local)string messageHuman-readable descriptionSFTP version 3 client on a caller-supplied channel.
The client is single-threaded and driven by explicit pumping. The channel belongs to the caller; closing the channel terminates all pending operations.
uint outstandingRequests() @property constReturns: the number of request IDs currently reserved by outstanding or cancelled-but-undrained operations.bool immediateWork() @property constReturns: whether the last pump stopped at its work quota while internal or immediately readable work remained.bool pump() @trustedAdvances the protocol: sends INIT when needed, moves channel bytes, and dispatches completed server packets.SftpOperation!(const(ubyte)[]) open(const(ubyte)[] path, uint flags,
SftpAttrs attrs = SftpAttrs.init)Opens or creates a remote file.SftpOperation!bool close(const(ubyte)[] handle)Closes a file or directory handle.SftpOperation!(const(ubyte)[]) read(const(ubyte)[] handle,
ulong offset, uint length)Reads data from a file handle at a position.SftpOperation!bool write(const(ubyte)[] handle, ulong offset,
const(ubyte)[] data)Writes data to a file handle at a position.SftpOperation!(const(ubyte)[]) opendir(const(ubyte)[] path)Opens a directory for listing.SftpOperation!(SftpName[]) readdir(const(ubyte)[] handle)Reads the next batch of directory entries.SftpOperation!bool remove(const(ubyte)[] path)Removes a file.SftpOperation!bool mkdir(const(ubyte)[] path,
SftpAttrs attrs = SftpAttrs.init)Creates a directory.SftpOperation!bool rmdir(const(ubyte)[] path)Removes a directory.SftpOperation!(immutable(ubyte)[]) realpath(const(ubyte)[] path)Canonicalizes a path.SftpOperation!bool rename(const(ubyte)[] oldPath,
const(ubyte)[] newPath)Renames a file or directory.SftpOperation!(immutable(ubyte)[]) readlink(const(ubyte)[] path)Reads a symlink target.SftpOperation!bool symlink(const(ubyte)[] targetPath,
const(ubyte)[] linkPath,
SftpSymlinkOrder order = SftpSymlinkOrder.openssh)Creates a symlink.SftpOperation!SftpServerLimits queryLimits()Queries the server's transfer limits through limits@openssh.com version 1.SftpOperation!bool posixRename(const(ubyte)[] oldPath,
const(ubyte)[] newPath)Renames a path with POSIX replace semantics through posix-rename@openssh.com version 1.SftpOperation!bool fsync(const(ubyte)[] handle)Flushes written data of an open handle to stable storage through fsync@openssh.com version 1.SftpOperation!SftpStatVfs statvfs(const(ubyte)[] path)Queries filesystem information for a path through statvfs@openssh.com version 2.SftpOperation!SftpStatVfs fstatvfs(const(ubyte)[] handle)Queries filesystem information for an open handle through fstatvfs@openssh.com version 2.SftpOperation!bool hardlink(const(ubyte)[] oldPath,
const(ubyte)[] newPath)Creates a hard link through hardlink@openssh.com version 1.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).uint effectiveReadChunk() const @safe pure nothrowReturns: the maximum READ data length local and negotiated limits allow; server zero-limits leave the local bound in effect.uint effectiveWriteChunk(size_t handleLength) const @safe pure nothrowParams: handleLength = Length of the handle used in WRITE requests.SftpOperation!SftpAttrs stat(const(ubyte)[] path)Retrieves attributes for a path while following symbolic links.SftpOperation!SftpAttrs lstat(const(ubyte)[] path)Retrieves attributes for a path without following symbolic links.SftpOperation!SftpAttrs fstat(const(ubyte)[] handle)Retrieves attributes for an open handle.SftpOperation!bool setstat(const(ubyte)[] path, SftpAttrs attrs)Updates attributes for a path.SftpOperation!bool fsetstat(const(ubyte)[] handle, SftpAttrs attrs)Updates attributes for an open handle.this(SshChannel channel)Constructs a client on an opened channel.