Crate remotefs_ftp

Crate remotefs_ftp 

Source
Expand description

§remotefs-ftp

remotefs-ftp is a client implementation for remotefs, providing support for the FTP/FTPS protocols.

§Get started

First of all you need to add remotefs and the client to your project dependencies:

remotefs = "^0.3"
remotefs-ftp = "^0.3"

these features are supported:

  • find: enable find() method on client (enabled by default)
  • native-tls: enable FTPS support using native-tls as backend
  • native-tls-vendored: enable static link for native-tls
  • no-log: disable logging. By default, this library will log via the log crate.
  • rustls: enable FTPS support using rustls as backend

§FTP client

use remotefs::RemoteFs;
use remotefs::client::ftp::FtpFs;
use std::path::Path;

let mut client = FtpFs::new("127.0.0.1", 21)
    .username("test")
    .password("password");
// connect
assert!(client.connect().is_ok());
// get working directory
println!("Wrkdir: {}", client.pwd().ok().unwrap().display());
// change working directory
assert!(client.change_dir(Path::new("/tmp")).is_ok());
// disconnect
assert!(client.disconnect().is_ok());

Re-exports§

pub use client::FtpFs;

Modules§

client
Ftp