Repository navigation
What's New
- Shell agent
stat- Read a remote file's metadata with the host's ownstat, at full timestamp resolution. SFTP attributes carry whole seconds; this returns modification, access, change and creation (birth) times as the file system stores them, plus size, kind, permissions, owner and inode on Unix hosts. It works on macOS, Linux and Windows (PowerShell andcmd).
let agent = try await client.shellAgent()
let status = try await agent.stat(file: "/data/report.pdf")
print(status.modificationDate, status.creationDate as Any)
// Describe a symlink itself and read its extended attributes
let link = try await agent.stat(file: "/data/latest", options: [.noFollowSymlinks, .extendedAttributes])- Nanosecond change detection in
ReferenceCache- WithtrustPolicy: .statOnServer, the cache now stats through the shell agent, so a changed file is noticed to the nanosecond instead of the second. Servers without shell access fall back to SFTP's whole seconds. - Shell Agent guide - The Shell Agent documentation now lives in its own page,
Documentation/ShellAgent.md.
Migration Guide
SwiftSFTP now requires Swift 6.4 (swift-tools-version: 6.4). Update your toolchain before moving to this version.