Description

pyinotify is a pure Python module for monitoring filesystems changes. pyinotify relies on a recent Linux Kernel feature (merged in kernel 2.6.13) called inotify. inotify is an event-driven notifier, its notifications are exported from kernel space to user space through three system calls. pyinotify binds these system calls and provides an implementation on top of them offering a generic and abstract way to use manipulate those functionalities. Pyinotify doesn't requires deep knowledge of inotify.

Download pyinotify 0.8.0s (under GPL 2)

Download Pyinotify

Browse Source Code and first look at the following examples loop.py, chain.py, stats.py, transient_file.py, daemon.py.

Dependancies

  • Linux Kernel >= 2.6.13
  • Python >= 2.4 (CPython)
  • GLibc >= 2.4
  • ctypes (included in Python 2.5 and installable from an external module for Python 2.4)

Install pyinotify

# 1- Make sure "Easy Install" is installed:
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ sudo python ez_setup.py
# 2- Install pyinotify:
$ sudo easy_install "http://git.dbzteam.org/?p=pyinotify.git;a=snapshot;h=HEAD;sf=tgz"
# 3- Try to run pyinotify (it watch /tmp by default):
$ python -m pyinotify -v

Documentation

Wiki

Those pages are freely editable thus feel free to edit the content and contribute to enhance the documentation you can also create a new page if you wish to introduce a full example using Pyinotify. Maybe a good starting point may be modifying this page PyinotifyExamples. You can also report/fix a problem by creating a ticket here.

Contact

For all others remarks please contact me directly at seb at dbzteam.org.