On 12/18/05, Quentin Mathé <[EMAIL PROTECTED]> wrote: > 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).
There is an UKKQueue (http://www.zathras.de/programming/sourcecode.htm) which wraps kqueue and work on file and directory. It seems to works as inotify. And people alwasy said inotify is equavalent to kqueue. http://developer.apple.com/documentation/Performance/Conceptual/FileSystem/Articles/TrackingChanges.html Therefore, I believe kqueue will work. > 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/ Well, then, another one for another platform. > > Unfortunately, kqueue is broken on mac. > > Have you done some tests ?… is this discussed somewhere in Apple > developer documentation ? Most people complain it in online discussion. Looks at the "download" section of libevent (http://www.monkey.org/~provos/libevent/). It is mentioned in 1.1-release. > > > 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 ? Yes, but save us time. > > > 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. There is a gamin (http://www.gnome.org/~veillard/gamin/) based on glib (GNOME project). It wrap inotify on Linux and kqueue on FreeBSD, but has not report on mac yet. But it may be a good start. Eventually we will need one. Is there anyone interested ? We only need a very simple one: found about which file is changed and report its path. Yen-Ju > > Quentin. > > -- > Quentin Mathé > [EMAIL PROTECTED] > > > _______________________________________________ > Etoile-dev mailing list > [email protected] > https://mail.gna.org/listinfo/etoile-dev >
