use std::fs::{
File,
read_to_string,
exists
};
pub struct ParsedFile {
pub file: String,
pub roots: Vec<String>,
}
impl ParsedFile {
pub fn new() -> Self {
let mut roots = vec!();
if !exists("paths.csv").unwrap() {
File::create("paths.csv").unwrap();
}
let file = read_to_string("paths.csv").unwrap();
file.split(',').for_each(|path| {
roots.push(path.trim().to_string());
});
Self {
file,
roots
}
}
}