Documentation ¶
Overview ¶
Package inotify provides an interface to the Linux inotify(7) API for monitoring filesystem events.
Index ¶
- type Event
- type Instance
- func (is *Instance) AddRecursiveWatch(path string, mask uint32) error
- func (is *Instance) AddTrigger(pattern string, mask uint32) error
- func (is *Instance) AddWatch(path string, mask uint32) error
- func (is *Instance) Close()
- func (is *Instance) Events() *stream.Stream
- func (is *Instance) RemoveWatch(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { unix.InotifyEvent // Name within watched path if it's a directory Name string // Watched path associated with the event Path string }
Event represents an inotify event
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents an initialized inotify instance
func (*Instance) AddRecursiveWatch ¶
AddRecursiveWatch adds the given path to the inotify instance's watch list as well as any directories recursively identified within it. Newly created subdirectories within the subtree rooted at path are added to the watch list as well.
func (*Instance) AddTrigger ¶
AddTrigger adds the given regular expression as a "watch trigger". When an event's full path matches it, a new watch is added for that event's full path with the given mask specifying the inotify events to be monitored.
func (*Instance) AddWatch ¶
AddWatch adds the given path to the inotify instance's watch list for events specified in the given mask. If the path is already being watched, the existing watch is modified.
func (*Instance) Close ¶
func (is *Instance) Close()
Close the inotify instance and allow the kernel to free its associated resources. All associated watches are automatically freed.
func (*Instance) RemoveWatch ¶
RemoveWatch removes the given path from the inotify instance's watch list.