Le 18 déc. 05 à 08:47, Yen-Ju Chen a écrit :

I am looking for a notifier for system-wide file change.
I found Linux has inotify and BSD has kqueue.

inotify and kqueue are very different, kqueue has been created to monitor kernel events and isn't tailored to monitor inodes specially unlike inotify. kqueue cannot thus be used to monitor system-wide file changes but only to monitor kernel events on a limited number of inodes (take not that any events on children inodes won't be reported).

In fact, Apple has developped its own extension (based on kqueue or not I don't remember) to be able to monitor whole file systems for Spotlight. You should read this link about it: http:// www.kernelthread.com/software/fslogger/

Unfortunately, kqueue is broken on mac.

Have you done some tests ?… is this discussed somewhere in Apple developer documentation ?

And there is a libevent to bypass the bug of kqueue on mac.

But libevent is only a wrapper library like FAM, isn't it ?

Although libevent is portable, it seems not designed to deal with file changes.

Does anyone have ideas about how to write or port a portable notifier
for file change ?

You cannot :-)… because only Linux and Mac OS X supports such features for now. FAM has fall back mechanisms though, but they are unusable in term of performance to monitor a whole file system.

Quentin.

--
Quentin Mathé
[EMAIL PROTECTED]


Reply via email to