remote-fs
Unified async file operations over SMB / FTP / SFTP.
Backends
Note: crates.io tokio-ssh2 (0.0.1) is abandoned; async-ssh2-tokio is the maintained Tokio SSH/SFTP client.
Usage
use remote_fs::{Client, FtpConfig, RemoteFileSystem, SmbConfig, SftpConfig};
#[tokio::main]
async fn main() -> remote_fs::Result<()> {
let mut ftp = Client::ftp(&FtpConfig::new("ftp.example.com", "user", "pass")).await?;
let mut sftp = Client::sftp(&SftpConfig::with_password("host", "user", "pass")).await?;
let mut smb = Client::smb(&SmbConfig::new("host", "share", "user", "pass")).await?;
let entries = ftp.list("/").await?;
ftp.write("/demo.txt", b"hello").await?;
ftp.download("/demo.txt", std::path::Path::new("./demo.txt")).await?;
ftp.disconnect().await?;
Ok(())
}