inotify

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const EventSize int = unix.SizeofInotifyEvent + 255 + 1

sizeof(struct inotify_event) + NAME_MAX + 1

Variables

View Source
var InotifyEvents = map[uint32]string{
	unix.IN_ACCESS:                          "ACCESS",
	unix.IN_ATTRIB:                          "ATTRIB",
	unix.IN_CLOSE_NOWRITE:                   "CLOSE_NOWRITE",
	unix.IN_CLOSE_WRITE:                     "CLOSE_WRITE",
	unix.IN_CREATE:                          "CREATE",
	unix.IN_DELETE:                          "DELETE",
	unix.IN_DELETE_SELF:                     "DELETE_SELF",
	unix.IN_MODIFY:                          "MODIFY",
	unix.IN_MOVED_FROM:                      "MOVED_FROM",
	unix.IN_MOVED_TO:                        "MOVED_TO",
	unix.IN_MOVE_SELF:                       "MOVE_SELF",
	unix.IN_OPEN:                            "OPEN",
	(unix.IN_ACCESS | unix.IN_ISDIR):        "ACCESS DIR",
	(unix.IN_ATTRIB | unix.IN_ISDIR):        "ATTRIB DIR",
	(unix.IN_CLOSE_NOWRITE | unix.IN_ISDIR): "CLOSE_NOWRITE DIR",
	(unix.IN_CLOSE_WRITE | unix.IN_ISDIR):   "CLOSE_WRITE DIR",
	(unix.IN_CREATE | unix.IN_ISDIR):        "CREATE DIR",
	(unix.IN_DELETE | unix.IN_ISDIR):        "DELETE DIR",
	(unix.IN_DELETE_SELF | unix.IN_ISDIR):   "DELETE_SELF DIR",
	(unix.IN_MODIFY | unix.IN_ISDIR):        "MODIFY DIR",
	(unix.IN_MOVED_FROM | unix.IN_ISDIR):    "MOVED_FROM DIR",
	(unix.IN_MOVE_SELF | unix.IN_ISDIR):     "MODE_SELF DIR",
	(unix.IN_OPEN | unix.IN_ISDIR):          "OPEN DIR",
}
View Source
var MaxWatchers int = -1

MaxWatchers is the maximum number of inotify watches supported by the Kernel set to -1 if the number cannot be determined

Functions

This section is empty.

Types

type Event

type Event struct {
	Name string
	Op   string
}

type Inotify

type Inotify struct {
	FD       int
	Watchers map[int]*Watcher
}

func NewInotify

func NewInotify() *Inotify

func (*Inotify) Close

func (i *Inotify) Close() error

func (*Inotify) Init

func (i *Inotify) Init() error

func (*Inotify) NumWatchers

func (i *Inotify) NumWatchers() int

func (*Inotify) ParseNextEvent

func (i *Inotify) ParseNextEvent(buf []byte) (*Event, uint32, error)

func (*Inotify) Read

func (i *Inotify) Read(buf []byte) (int, error)

func (*Inotify) Watch

func (i *Inotify) Watch(dir string) error

type Watcher

type Watcher struct {
	WD  int
	Dir string
}

Jump to

Keyboard shortcuts

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