Cross-platform filesystem notification library for Rust.
(Looking for desktop notifications instead? Have a look at notify-rust or alert-after!)
- API Documentation
- Crate page
- Earliest supported Rust version: 1.26.1
As used by: alacritty, cargo watch, cobalt, docket, handlebars-iron, mdBook, pax, rdiff, timetrack, watchexec, xi-editor, and others.
 = "4.0.17"
extern crate notify; use ; use channel; use Duration;
Looking overly verbose? Too much boilerplate? Have a look at hotwatch, a friendly wrapper:
// Taken from the hotwatch readme use ; let mut hotwatch = new.expect; hotwatch.watch.expect;
- Linux / Android: inotify
- macOS: FSEvents
- Windows: ReadDirectoryChangesW
- All platforms: polling
Due to the inner security model of FSEvents (see FileSystemEventSecurity), some event cannot be observed easily when trying to follow files that do not belong to you. In this case, reverting to the pollwatcher can fix the issue, with a slight performance cost.
Inspired by Go's fsnotify and Node.js's Chokidar, born out of need for cargo watch, and general frustration at the non-existence of C/Rust cross-platform notify libraries.
Written by Félix Saparelli and awesome contributors, and released in the Public Domain using the Creative Commons Zero Declaration.