rootftp 0.1.4

A simple FTP server tool that allows you to play with files. Multiple users can share their files with each other. You can also build custom plugins see examples for more info.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::config::Config;
use std::fs;
use std::io;

pub fn init() -> io::Result<()> {
    let config = Config::load();
    let root_dir = config.root_dir.clone();
    let ftpd = root_dir.join("ftpd");
    let plugins = root_dir.join("plugins");
    let credentials = root_dir.join("credentials.json");
    fs::create_dir_all(&root_dir)?;
    fs::create_dir_all(&ftpd)?;
    if !credentials.exists() {
        fs::File::create(&credentials)?;
    }
    fs::create_dir_all(&plugins)?;
    Ok(())
}