Registry / utility / rjeczalik-notify

rjeczalik-notify

JSON →
library0.9.3gogounverified

High-level filesystem event notification library supporting inotify, kqueue, FSEvents, FEN, and ReadDirectoryChangesW.

go get github.com/rjeczalik/notify
INSTALL
IMPORT
SIG · RJECZALIK-NOTIFY
R
rjeczalik-notify
utilitygov0.9.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

notify
github.com/rjeczalik/notify

Watch a directory for all filesystem events and print the first event.

package main import ( "log" "github.com/rjeczalik/notify" ) func main() { c := make(chan notify.EventInfo, 1) err := notify.Watch("/tmp", c, notify.All) if err != nil { log.Fatal(err) } defer notify.Stop(c) ei := <-c log.Printf("Event: %s on %s", ei.Event(), ei.Path()) }
Debug
Known issues
gotchaOn Linux, recursive watching is not natively supported; the library emulates it, which may miss events in deeply nested directories.
fix
Use FSEvents (macOS) or ReadDirectoryChangesW (Windows) for reliable recursive watching.
affects: >=0.9.0
Upgrade
Version history
0.9.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
rjeczalik-notify — go get rjeczalik-notify · libregistry