Pike v8.1 release 6

Method System.Inotify.parse_event()


Method parse_event

array(string|int) parse_event(string data)

Description

Parses one inotify_event struct from data.

Returns

Returns an array consisting of

Array
int 0

The watch descriptor returned by _Instance()->add_watch() when the watch for this file was added.

int 1

An integer that describes the event that occured. See the inotify manpage for a list of possible events and their numerical identifiers.

int 2

An integer cookie that can be used to group together different events that were triggered by moving a file from one location to another.

string 3

The name of the file. This will only be present if the event happened to a file in a directory that was watched, e.g. with System.Inotify.IN_CREATE. Otherwise this will be 0.

int 4

The length of the data that has been parsed. If the data string contains more than one inotify event, this parse function needs to be called again with the remainder as an argument.