Skip to main content

A simple wrapper around inotify. No fancy bells and whistles, just a literal wrapper with ctypes. Only 95 lines of code!

Project description

inotify_init() is wrapped as a class that does little more than hold the resulting inotify file descriptor. A read() method is provided which reads available data from the file descriptor and returns events as namedtuples after unpacking them with the struct module. inotify_add_watch() and inotify_rm_watch() are wrapped with no changes at all, taking and returning watch descriptor integers that calling code is expected to keep track of itself, just as one would use inotify from C. Works with Python 2 or 3.

Fork me on github: https://github.com/chrisjbillington/inotify_simple Read the docs: http://inotify_simple.readthedocs.org

Installation:

to install inotify_simple, run:

$ pip install inotify_simple

or to install from source:

$ python setup.py install

Note: If on Python < 3.4, you’ll need the backported enum34 module (https://pypi.python.org/pypi/enum34).

inotify_simple is a small amount of code and unlikely to change much in the future until inotify itself or Python changes, so you can also just copy and paste it into your project to avoid the extra dependency with pretty low risk.

See full documentation at http://inotify_simple.readthedocs.org

Project details


Download files

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

Source Distribution

inotify_simple-1.0.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file inotify_simple-1.0.1.tar.gz.

File metadata

File hashes

Hashes for inotify_simple-1.0.1.tar.gz
Algorithm Hash digest
SHA256 61ac77157c96940133332d576a3b0952376f0f0fe49952b801600629d6b5464d
MD5 5758a109d3c288bfdd0967666f5daa0f
BLAKE2b-256 897ca99c53ed2a8c5551a38280697985360fe41895f27f986e2931870753797e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page