First release of pyfsevents

Nicolas Dumazet nicdumz at gmail.com
Thu Sep 3 23:03:54 CEST 2009


On Sep 3, 10:33 pm, a... at pythoncraft.com (Aahz) wrote:
> I'm curious why you went with FSEvents rather than kqueue.  My company
> discovered that FSEvents is rather coarse-grained: it only tells you that
> there has been an event within a directory, it does *not* tell you
> anything about the change!

It depends what you want to do with your events. In my case, knowing
that an event occurred in a directory is sufficient because I already
know the state of the directory.
If you look in the examples/ folder, (watcher) you'll find that with
very little work, you can maintain a directory snapshot in memory and
compare it against the new state of the directory to know exactly what
happened, when necessary.

kqueue has the limitation that kern.kq_calloutmax is usually set at
4096. Meaning that one could not use this on a big (Mercurial)
repository with 5k files. FSEvents on the other hand saves us the
trouble to have to register each file individually.
Also, I am not quite sure if we can use kqueue to register a
directory, to be warned when a file is created in this directory.






More information about the Python-list mailing list