go-fswatch: Go bindings for libfswatch
August 13, 2024 · View on GitHub
Go bindings for libfswatch.
libfswatch provides comprehensive, cross-platform file change monitoring capabilities.
Features
go-fswatch exposes all features provided by fswatch and libfswatch through an idiomatic Go API:
- cross-platform: inotify (Linux), FSEvents (macOS), Windows, kqueue (*BSD), File Events Notification (Solaris) and polling
- watch files and directories
- recursive watching
- file and directory filtering (using regular expressions)
- events filtering
Install
First, install libfswatch:
- Download the latest release (
fswatch-<version>.tar.gz) - Compile and install
libfswatch:
tar xzf fswatch-*.tar.gz
cd fswatch-*
./configure
make
sudo make install
Then, you can use this Go module as usual:
go get github.com/dunglas/go-fswatch
Usage and Examples
See the documentation.
Cgo
This package depends on cgo. If you are looking for non-cgo alternatives, see:
Credits
Created by Kévin Dunglas and sponsored by Les-Tilleuls.coop.