inotify

package
v0.0.0-...-06c1dd3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	WatchDescriptor int
	Mask            Mask
	Cookie          uint
	Name            string
}

type Flag

type Flag int
const (
	FlagCloseOnExec Flag = syscall.IN_CLOEXEC
	FlagNonBlocking Flag = syscall.IN_NONBLOCK
)

type Mask

type Mask uint32
const (
	MaskAccessed         Mask = syscall.IN_ACCESS
	MaskAttributeChanged Mask = syscall.IN_ATTRIB
	MaskWriteClosed      Mask = syscall.IN_CLOSE_WRITE
	MaskNoWriteClosed    Mask = syscall.IN_CLOSE_NOWRITE
	MaskCreated          Mask = syscall.IN_CREATE
	MaskDeletedFrom      Mask = syscall.IN_DELETE
	MaskDeleted          Mask = syscall.IN_DELETE_SELF
	MaskModified         Mask = syscall.IN_MODIFY
	MaskMoved            Mask = syscall.IN_MOVE_SELF
	MaskMovedFrom        Mask = syscall.IN_MOVED_FROM
	MaskMovedTo          Mask = syscall.IN_MOVED_TO
	MaskOpened           Mask = syscall.IN_OPEN

	MaskDontFollow        Mask = syscall.IN_DONT_FOLLOW
	MaskExcludingUnlinked Mask = syscall.IN_EXCL_UNLINK
	MaskOneshot           Mask = syscall.IN_ONESHOT
	MaskDirectoryOnly     Mask = syscall.IN_ONLYDIR

	MaskIgnored              Mask = syscall.IN_IGNORED
	MaskIsDirectory          Mask = syscall.IN_ISDIR
	MaskEventQueueOverflowed Mask = syscall.IN_Q_OVERFLOW
	MaskUnmounted            Mask = syscall.IN_UNMOUNT
)

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(flags ...Flag) (*Watcher, error)

func (*Watcher) Add

func (w *Watcher) Add(path string, mask Mask) (int, error)

Add adds a watch for the given path and mask, returning a watch descriptor.

func (Watcher) Close

func (w Watcher) Close() error

Close closes the underlying inotify file descriptor.

func (Watcher) Events

func (w Watcher) Events() <-chan Event

Events starts a new Go-routine that sends Events related to paths previously registered through Add to a channel returned by this function.

func (*Watcher) Remove

func (w *Watcher) Remove(wd int) error

Remove removes a watch that was previously registered through Add.

Jump to

Keyboard shortcuts

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