inotify

package
v0.13.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package inotify provides an interface to the Linux inotify(7) API for monitoring filesystem events.

Index

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 NewInstance

func NewInstance() (*Instance, error)

NewInstance creates a new inotify instance

func (*Instance) AddWatch

func (is *Instance) AddWatch(path string, mask uint32) error

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) Events

func (is *Instance) Events() *stream.Stream

Events returns a Event stream.Stream of the inotify instance's events

func (*Instance) RemoveWatch

func (is *Instance) RemoveWatch(path string) error

RemoveWatch removes the given path from the inotify instance's watch list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL