#file-watcher #path #list #callback #calls #change

bin+lib watchr_filesystem

A simple file watcher that watches a list of paths and calls a callback when any of them change

1 unstable release

new 0.1.0 Jan 24, 2025

#592 in Filesystem

Download history 103/week @ 2025-01-22

103 downloads per month

MIT license

96KB

Watchr

A simple and efficient Rust library for watching file system changes. It is built on top of notify and tokio crates.

Features

  1. Simple API for watching file system changes like creation, modification, deletion and renaming
  2. Fully async-compatible using tokio runtime
  3. Provides wrapper over notify events

Watchr in action

Installation

Add watchr_filesystem to your Cargo.toml:

[dependencies]
watchr_filesystem = "0.1.0"

Usage

use watchr_filesystem::FileWatcher;

let watcher = FileWatcher::new(vec![PathBuf::from("./destination")]);

watcher.watch(callbackFunction);

License

This project is released under the MIT License.


lib.rs:

Watchr

A simple file watcher that watches a list of paths and calls a callback when any of them change

Dependencies

~3–11MB
~101K SLoC