inotify

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType uint8

Event types

const (
	FolderCreate EventType = iota
	FileCreate
	Delete
	Modified
	MovedFrom
	MovedTo
	WatchStop
)

type InotifyEvent

type InotifyEvent struct {
	Path  string
	Event EventType
}

InotifyEvent represents a file system event

type Watcher

type Watcher struct {
	Events chan InotifyEvent
	// contains filtered or unexported fields
}

Watcher handles inotify watching for a directory

func New

func New(path string) (*Watcher, error)

New creates a new inotify watcher for the specified path

func (*Watcher) Close

func (w *Watcher) Close() error

Close stops the watcher

func (*Watcher) Watch

func (w *Watcher) Watch() error

Watch starts watching for file system events

Jump to

Keyboard shortcuts

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