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
IN_ACCESS
public
mixed
IN_ACCESS
= 1
IN_ALL_EVENTS
public
mixed
IN_ALL_EVENTS
= 4095
IN_ATTRIB
public
mixed
IN_ATTRIB
= 4
IN_CLOSE
public
mixed
IN_CLOSE
= 24
IN_CLOSE_NOWRITE
public
mixed
IN_CLOSE_NOWRITE
= 16
IN_CLOSE_WRITE
public
mixed
IN_CLOSE_WRITE
= 8
IN_CREATE
public
mixed
IN_CREATE
= 256
IN_DELETE
public
mixed
IN_DELETE
= 512
IN_DELETE_SELF
public
mixed
IN_DELETE_SELF
= 1024
IN_DONT_FOLLOW
public
mixed
IN_DONT_FOLLOW
= 33554432
IN_EXCL_UNLINK
public
mixed
IN_EXCL_UNLINK
= 67108864
IN_MASK_ADD
public
mixed
IN_MASK_ADD
= 536870912
IN_MODIFY
public
mixed
IN_MODIFY
= 2
IN_MOVE
public
mixed
IN_MOVE
= 192
IN_MOVE_SELF
public
mixed
IN_MOVE_SELF
= 2048
IN_MOVED_FROM
public
mixed
IN_MOVED_FROM
= 64
IN_MOVED_TO
public
mixed
IN_MOVED_TO
= 128
IN_ONESHOT
public
mixed
IN_ONESHOT
= 2147483648
IN_ONLYDIR
public
mixed
IN_ONLYDIR
= 16777216
IN_OPEN
public
mixed
IN_OPEN
= 32
Properties
$available
private
bool
$available
$handle
private
resource|false
$handle
$watchDescriptors
private
array<string|int, mixed>
$watchDescriptors
= []
Methods
__construct()
public
__construct() : mixed
__destruct()
public
__destruct() : mixed
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
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
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
Return values
intclose()
Close the inotify instance
public
close() : void
getConstant()
Get a constant value safely
public
getConstant(string $constantName) : int
Parameters
- $constantName : string
Tags
Return values
intgetWatchDescriptors()
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|nullinit()
Initialize an inotify instance
public
init() : void
Tags
isAvailable()
Check if inotify is available
public
isAvailable() : bool
Return values
boolisInitialized()
Check if inotify is initialized
public
isInitialized() : bool
Return values
boolread()
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
boolwaitForEvents()
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