Bånder

InotifyWrapper
in package

Table of Contents

Constants

IN_ACCESS  = 1
IN_ALL_EVENTS  = 4095
IN_ATTRIB  = 4
IN_CLOSE  = 24
IN_CLOSE_NOWRITE  = 16
IN_CLOSE_WRITE  = 8
IN_CREATE  = 256
IN_DELETE  = 512
IN_DELETE_SELF  = 1024
IN_DONT_FOLLOW  = 33554432
IN_EXCL_UNLINK  = 67108864
IN_MASK_ADD  = 536870912
IN_MODIFY  = 2
IN_MOVE  = 192
IN_MOVE_SELF  = 2048
IN_MOVED_FROM  = 64
IN_MOVED_TO  = 128
IN_ONESHOT  = 2147483648
IN_ONLYDIR  = 16777216
IN_OPEN  = 32

Properties

$available  : bool
$handle  : resource|false
$watchDescriptors  : array<string|int, mixed>

Methods

__construct()  : mixed
__destruct()  : mixed
addWatch()  : int
Add a watch to an inotify instance
addWatchRecursive()  : int
Add recursive watch to a directory
buildMask()  : int
Build a mask from multiple constants
close()  : void
Close the inotify instance
getConstant()  : int
Get a constant value safely
getWatchDescriptors()  : array<string|int, mixed>
Get all watch descriptors and their paths
getWatchPath()  : string|null
Get the pathname for a watch descriptor
init()  : void
Initialize an inotify instance
isAvailable()  : bool
Check if inotify is available
isInitialized()  : bool
Check if inotify is initialized
read()  : array<string|int, mixed>|false
Read events from an inotify instance
removeWatch()  : bool
Remove an existing watch from an inotify instance
waitForEvents()  : array<string|int, mixed>|false
Wait for events with timeout

Constants

Properties

$watchDescriptors

private array<string|int, mixed> $watchDescriptors = []

Methods

addWatch()

Add a watch to an inotify instance

public addWatch(string $pathname, int $mask) : int
Parameters
$pathname : string

The file or directory to be watched

$mask : int

The events to be watched for

Tags
throws
InotifyException
Return values
int

The watch descriptor

addWatchRecursive()

Add recursive watch to a directory

public addWatchRecursive(string $path, int $mask) : int
Parameters
$path : string

Directory path to watch

$mask : int

Events to watch for

Tags
throws
InotifyException
Return values
int

Number of watches added

buildMask()

Build a mask from multiple constants

public buildMask(array<string|int, mixed> $constants) : int
Parameters
$constants : array<string|int, mixed>
Tags
throws
InotifyException
Return values
int

getConstant()

Get a constant value safely

public getConstant(string $constantName) : int
Parameters
$constantName : string
Tags
throws
InotifyException
Return values
int

getWatchDescriptors()

Get all watch descriptors and their paths

public getWatchDescriptors() : array<string|int, mixed>
Return values
array<string|int, mixed>

getWatchPath()

Get the pathname for a watch descriptor

public getWatchPath(int $watchDescriptor) : string|null
Parameters
$watchDescriptor : int
Return values
string|null

isAvailable()

Check if inotify is available

public isAvailable() : bool
Return values
bool

isInitialized()

Check if inotify is initialized

public isInitialized() : bool
Return values
bool

read()

Read events from an inotify instance

public read() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

Array of events or false if no events

removeWatch()

Remove an existing watch from an inotify instance

public removeWatch(int $watchDescriptor) : bool
Parameters
$watchDescriptor : int
Return values
bool

waitForEvents()

Wait for events with timeout

public waitForEvents([int $timeoutMicroseconds = 100000 ]) : array<string|int, mixed>|false
Parameters
$timeoutMicroseconds : int = 100000

Timeout in microseconds

Return values
array<string|int, mixed>|false

Events or false on timeout/error


        
On this page

Search results