Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Low level interface to FSEvents primitives

Project description


pyfsevents is a C extension providing a Python interface for Mac OS X 10.5 and later which allows monitoring for file system events, using FSEvents.

pyfsevents uses a callback mechanism: see Module Documentation.


python install


Distributed under the terms of the MIT License.


Mac OS X >= 10.5 Leopard


Thread-unsafe: CFRunLoop’s and Python threads do not quite interact well when put together :)

Module Documentation

pyfsevents uses a callback mechanism.

It provides two functions:

  • registerfd(fd, callback[, mask])
  • registerpath(path, callback)

to register objects to monitor.

After registration, listen() should be called to wait for events. The call is blocking: callbacks are fired on events.

stop() is available to stop the listen() call. stop() should be called from a different thread.

Please see examples/ for use cases of the extension.

callback signatures

The callback arguments passed to register* functions will be fired on events. These callback functions should be functions callable with two arguments, as listen will call these functions with two arguments:

  • For File descriptors, registerfd callbacks will be passed (fd, mask) arguments:


    file descriptor which changed and fired the callback.


    the POLLIN / POLLOUT mask, similar to the select.poll module.

  • For FSEvents, registerpath callbacks will be passed (path, recursive) arguments:


    the path where the event occurred.


    a boolean: if True, the caller should check recursively the directory tree for changes, and not only the specified directory.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyfsevents, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size pyfsevents-0.1.tar.gz (12.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page