| Crates.io | mount-watcher |
| lib.rs | mount-watcher |
| version | 0.5.0 |
| created_at | 2025-06-05 15:53:59.086269+00 |
| updated_at | 2025-07-07 12:27:12.232913+00 |
| description | Get notified when a filesystem is mounted/unmounted |
| homepage | |
| repository | https://github.com/TheElectronWill/rust-mount-watcher/ |
| max_upload_size | |
| id | 1701732 |
| size | 48,648 |
Get notified when a filesystem is mounted/unmounted! (Linux only)
Key features:
epoll to watch /proc/mounts in an efficient way: no busy polling.let watch = MountWatcher::new(|event| {
if event.initial {
println!("initial mount points: {:?}", event.mounted);
} else {
println!("new mounts: {:?}", event.mounted);
println!("removed mounts: {:?}", event.unmounted);
}
WatchControl::Continue
});
// store the watcher somewhere (it will stop on drop)