use std::{env, fs::File, io::{self, BufRead, Read, Write}, path::Path, thread::{self, sleep}, time::Duration};
use basicftp::RustTP;
fn main() {
let args: Vec<String> = env::args().collect();
let lines = read_lines("paths.txt").unwrap();
let list = lines.flatten().map(|e| e.to_string()).collect::<Vec<String>>();
let (server,thread) = RustTP::new_with_paths(list, &args[1], &args[2]);
thread.join().unwrap();
}
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
where P: AsRef<Path>, {
let file = File::open(filename)?;
Ok(io::BufReader::new(file).lines())
}