fsnotify

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcFsFd     = "/proc/self/fd"
	ProcFsFdInfo = "/proc/self/fdinfo"
)

Procfs constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action uint

action

const (
	MarkAdd Action = 1 << iota
	MarkRemove
	MarkFlush
)

type Event

type Event struct {
	Name_ string // Relative path to the file or directory.
	Op_   Op     // File operation that triggered the event.
}

Event represents a single file system notification.

type Op

type Op uint

Op describes a set of file operations.

const (
	Create Op = 1 << iota
	Write
	Remove
	Rename
	Chmod
)

These are the generalized file operations that can trigger a notification.

type Watcher

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

func New

func New() (*Watcher, error)

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Mark

func (w *Watcher) Mark(fileName string, act Action) error

func (*Watcher) ResponseAllow

func (w *Watcher) ResponseAllow(ev *unix.FanotifyEventMetadata) error

func (*Watcher) ResponseDeny

func (w *Watcher) ResponseDeny(ev *unix.FanotifyEventMetadata) error

ResponseDeny sends a deny message back to fanotify, used for permission checks.

func (*Watcher) Wait

func (w *Watcher) Wait() (Event, error)

Jump to

Keyboard shortcuts

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