Crates.io | foldeye |
lib.rs | foldeye |
version | 1.0.6 |
source | src |
created_at | 2022-08-29 08:54:28.530396 |
updated_at | 2022-08-29 12:01:40.895979 |
description | Framework for watching files and directories |
homepage | |
repository | |
max_upload_size | |
id | 654321 |
size | 29,796 |
A simple rust crate built for watching changes in a folder.
use foldeye::*;
fn main() -> Result<(), std::io::Error> {
let path = "./".to_string();
let directory = Directory::new(&path.clone())?;
let chron_timing = "1/1 * * * * *".to_string();
let chron = Chron::new(path.clone(), chron_timing, directory);
chron.watch_folder(&path, &|comparison| {
for action in comparison.action {
match action {
ComparisonActionEnum::Inserted(files) => { println!("Inserted: {:?}", files); }
ComparisonActionEnum::Removed(files) => { println!("Removed: {:?}", files); }
ComparisonActionEnum::Replaced(files) => { println!("Replaced: {:?}", files); }
}
}
})?;
}
Ok(())
}
https:://crates.io/crates/foldeye