Documentation
¶
Overview ¶
Package fswatch reports file changes below directories without holding a descriptor per watched file.
macOS uses one FSEvents stream per watched root. Other systems use fsnotify: inotify holds one watch per directory and Windows one handle per directory. fsnotify's kqueue backend is not used on macOS because it opens every file of a watched directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
Event names one changed path. Lost is set when the path was a directory added with Dir whose watch ended because it was removed or renamed; add it again once it exists.
type Watcher ¶
type Watcher struct {
Events chan []Event
// Errors reports a backend failure such as an overflowed event queue;
// changes may have been missed.
Errors chan error
// contains filtered or unexported fields
}
Watcher delivers changed paths in batches. Events and Errors close after Close.
func (*Watcher) Dir ¶
Dir watches the entries of one directory. root is the directory tree that holds it; it matters only on macOS, where one stream on root serves every directory added under it.