file_update_monitor

Crates.iofile_update_monitor
lib.rsfile_update_monitor
version0.1.2
created_at2025-01-02 10:00:56.407795+00
updated_at2025-01-03 01:37:12.029751+00
descriptionIt watches a directory for file changes and triggers a callback when files are modified.
homepagehttps://github.com/lichtcui/file_update_monitor
repositoryhttps://github.com/lichtcui/file_update_monitor
max_upload_size
id1501397
size9,490
Licht Cui (lichtcui)

documentation

README

File Update Monitor

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.

Main Features

  • Monitor file changes in specified directories and subdirectories
  • Support debouncing to avoid too frequent updates
  • Asynchronous handling of file change events
  • Customizable logic for handling file changes

Installation

cargo add file_update_monitor

Usage

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(())
}
Commit count: 0

cargo fmt