Login or Sign up

All Photos Matching "inotify"

No photos matching tag. No bookmarks matching tag.

All Blog Posts Matching "inotify"

These are blog posts from everyone:

用 inotify 监控文件目录的变化

inotiy: .. code-block:: python #/usr/bin/env python import os from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent wm = WatchManager() mask = EventsCodes.IN_DELETE | EventsCodes.IN_CREATE # watched events class PTmp(ProcessEvent): def process_IN_CREATE(self, event): print " Create: %s " % os.path.join(event.path, event.name) def process_IN_DELETE(self, event): print " Remove: %s " % os.path.join(event.path, event.name) notifier = Notifier(wm, PTmp()) wdd = wm.add_watch('/tmp', mask, rec=True) while True: # loop forever try : # process the queue of events as explained above notifier.process_events() if notifier.check_events(): # read notified events and enqeue them notifier.read_events() # you can do some tasks here... except KeyboardInterrupt: # destroy the inotify's instance on this interrupt (stop monitoring) notifier.stop() break

All Projects Matching inotify

All Project Topics Matching inotify

All Project Tasks Matching inotify

All Tribes Matching inotify

All Tribe Topics Matching inotify

All Wiki Articles Matching inotify