Go bindings for libfswatch.
libfswatch provides comprehensive, cross-platform file change monitoring capabilities.
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
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 installThen, you can use this Go module as usual:
go get github.com/dunglas/go-fswatchSee the documentation.
This package depends on cgo. If you are looking for non-cgo alternatives, see:
Created by Kévin Dunglas and sponsored by Les-Tilleuls.coop.