Crate unftp_sbe_iso

Crate unftp_sbe_iso 

Source
Expand description

A libunftp storage back-end that allows FTP access to “.iso” (ISO 9660) files.

§Usage

Add the libunftp and tokio crates to your project’s dependencies in Cargo.toml:

[dependencies]
libunftp = "0.20.3"
unftp-sbe-iso = "0.1"
tokio = { version = "1", features = ["full"] }

Add the following to src/main.rs:

use libunftp::ServerBuilder;
use unftp_sbe_iso::Storage;
#[tokio::main(flavor = "current_thread")]
async fn main() {
    let addr = "127.0.0.1:2121";

    let server = ServerBuilder::new(Box::new(move || Storage::new("/path/to/your/image.iso")))
        .greeting("Welcome to my ISO over FTP")
        .passive_ports(50000..=65535)
        .build()
        .unwrap();

    println!("Starting FTP server on {}", addr);
    server.listen(addr).await.unwrap();
}

You can now run your server with cargo run and connect to localhost:2121 with your favourite FTP client e.g.:

lftp localhost -p 2121

Structs§

IsoMeta
Implements libunftp’s Metadata trait
Storage
A virtual file system that tells libunftp how to access “.iso” (ISO 9660) files.