Next: , Previous: , Up: System dependencies   [Contents][Index]


6.2 BSD systems

When compiled on BSD systems (including Darwin), direvent uses kqueue (see kernel event notification mechanism in kqueue(2) man page).

This interface needs an open file handle for each file in a monitored directory, which means that the number of watchers is limited by the maximum number of open files. Use ‘ulimit -n NUM’ in order to raise it to a higher number.

Since it operates on files, kqueue does not provide direct support for the ‘create’ generic event. Direvent works over this disadvantage by keeping track of the contents of each monitored directory and rescanning it each time a ‘WRITE’ system event is reported for it. It then generates the ‘open’ event for each file that appeared after the last scan. Such a rescan can consume considerable time if a directory has a very large number of files in it.

The following system-dependent events are available:

DELETE

The unlink() system call was called on the monitored file.

WRITE

A write occurred on the file.

EXTEND

The file was extended.

ATTRIB

The file attributes have changed.

LINK

The link count on the file changed.

RENAME

The file was renamed.

REVOKE

Access to the file was revoked via revoke() (see revoke file access in revoke(2) man page) or the underlying file system was unmounted.

On FreeBSD and NetBSD, the following events are additionally available:

CLOSE

File not opened for writing was closed.

CLOSE_WRITE

File opened for writing was closed.

OPEN

File was opened.

READ

File was read.

The change generic event (see change) is supported only on FreeBSD and NetBSD.


Next: , Previous: , Up: System dependencies   [Contents][Index]