remote-fs 0.1.0

Unified async file operations over SMB, FTP, and SFTP
Documentation

remote-fs

Unified async file operations over SMB / FTP / SFTP.

Backends

Protocol Crate
SMB smb2
FTP async-ftp
SFTP async-ssh2-tokio (+ russh-sftp)

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(())
}