Part of twisted.internet View Source
This module provides support for Twisted to linux inotify API.
In order to use this support, simply do the following (and start a reactor at some point):
from twisted.internet import inotify
from twisted.python import filepath
def notify(self, filepath, mask):
print "event %s on %s" % (
', '.join(inotify.humanReadableMask(mask)), filepath)
notifier = inotify.INotify()
notifier.startReading()
notifier.watch(filepath.FilePath("/some/directory"), callbacks=[notify])
| Present Since | 10.1 | |
| Function | humanReadableMask | Auxiliary function that converts an hexadecimal mask into a series |
| Class | INotify | The INotify file descriptor, it basically does everything related |
| Class | _Watch | Watch object that represents a Watch point in the filesystem. The |