# Fsig
Filesystem signal crate for monitoring, debouncing, and filtering events.
`fsig` abstracts away the boilerplate of setting up file watchers, handling noisy OS events, and filtering relevant changes. It turns raw filesystem notifications into clean, deduplicated signals your application can act on.
## Features
- **Debouncing**: Configurable time window to merge rapid successive events into one.
- **Event Coalescing**: Intelligent state machine that merges `Create→Modify` sequences and handles OS-specific noise.
- **Glob Filtering**: Include/exclude files using glob patterns with full `**` recursive support (powered by `globset`).
- **Hidden File Filtering**: Automatically ignore dotfiles and dot-directories.
- **Multi-Subscriber**: Broadcast channel allows multiple consumers to receive the same events.
- **Stream API**: `futures::Stream` integration for ergonomic async iteration.
- **Watcher Groups**: Manage multiple named watchers with a unified interface.
## Usage Examples
Check the `examples` and `tests` directories for runnable code:
- **Basic Usage**: [`examples/simple.rs`](examples/simple.rs) - Monitor a directory and receive debounced events.
- **Watcher Lifecycle**: [`tests/integration.rs`](tests/integration.rs) - Create, modify, and remove file events.
- **Watcher Groups**: [`tests/integration.rs`](tests/integration.rs) - Manage multiple named watchers.
- **Hidden File Filtering**: [`tests/integration.rs`](tests/integration.rs) - Ignore dotfiles and handle temp file noise.
- **Event Kind Filtering**: [`tests/integration.rs`](tests/integration.rs) - Listen only for specific event types.
## Installation
```toml
[dependencies]
fsig = { version = "0.2", features = ["full"] }
```
### Feature Flags
| `match` | Enable glob pattern filtering (`Target::Filtered`) |
| `stream` | Enable `futures::Stream` API via `Watcher::stream()` |
| `serde` | Derive `Serialize`/`Deserialize` for config types |
| `logging` | Enable `tracing` integration for error logging |
| `full` | All of the above |
## License
Released under the MIT License © 2026 [Canmi](https://github.com/canmi21)