| Crates.io | file_update_monitor |
| lib.rs | file_update_monitor |
| version | 0.1.2 |
| created_at | 2025-01-02 10:00:56.407795+00 |
| updated_at | 2025-01-03 01:37:12.029751+00 |
| description | It watches a directory for file changes and triggers a callback when files are modified. |
| homepage | https://github.com/lichtcui/file_update_monitor |
| repository | https://github.com/lichtcui/file_update_monitor |
| max_upload_size | |
| id | 1501397 |
| size | 9,490 |
A Rust library for monitoring file changes. It provides a simple interface to watch file changes in directories and execute custom callback functions when file content changes.
cargo add file_update_monitor
use file_update_monitor::Monitor;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let monitor = Monitor::new("./", 1000, |path| {
println!("File updated: {}", path);
Ok(())
});
monitor.start().await;
Ok(())
}