remote-fs
Unified async file operations over SMB / FTP / SFTP.
Features(按需加载)
默认不启任何协议。
# 只要 FTP
= { = "0.1", = ["ftp"] }
# SMB + SFTP
= { = "0.1", = ["smb", "sftp"] }
# 全开
= { = "0.1", = ["full"] }
Usage
use ;
async
Unified async file operations over SMB / FTP / SFTP.
默认不启任何协议。
# 只要 FTP
remote-fs = { version = "0.1", features = ["ftp"] }
# SMB + SFTP
remote-fs = { version = "0.1", features = ["smb", "sftp"] }
# 全开
remote-fs = { version = "0.1", features = ["full"] }
use remote_fs::{Client, FtpConfig, RemoteFileSystem};
#[tokio::main]
async fn main() -> remote_fs::Result<()> {
let mut ftp = Client::ftp(&FtpConfig::new("ftp.example.com", "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(())
}