Watchdog

Software Screenshot:
Watchdog
Software Details:
Version: 0.6.0
Upload Date: 14 Apr 15
Developer: Gora Khargosh
Distribution Type: Freeware
Downloads: 3

Rating: nan/5 (Total Votes: 0)

Watchdog is a Python API to monitor filesystem events.

Watchdog lets your Python programs monitor filesystem events as portably as possible using:

* inotify on Linux
* FSEvents on Mac OS X
* Windows API on Windows
* polling as a fallback mechanism

Example Usage:

< pre >import sys
import time
from watchdog import Observer, FileSystemEventHandler
import logging

logging.basicConfig(level=logging.DEBUG)

class MyEventHandler(FileSystemEventHandler):
    def catch_all_handler(self, event):
        logging.debug(event)

    def on_moved(self, event):
        self.catch_all_handler(event)

    def on_created(self, event):
        self.catch_all_handler(event)

    def on_deleted(self, event):
        self.catch_all_handler(event)

    def on_modified(self, event):
        self.catch_all_handler(event)

event_handler = MyEventHandler()
observer = Observer()
observer.schedule('a-unique-name', event_handler, *sys.argv[1:])
observer.start()
try:
    while True:
        time.sleep(1)
except KeyboardInterrupt:
    observer.unschedule('a-unique-name')
    observer.stop()
observer.join()< /pre >

Requirements:

  • Python
  • pyinotify

Similar Software

Tenshi
Tenshi

14 Apr 15

GtkEveMon
GtkEveMon

3 Jun 15

NDisc6
NDisc6

11 May 15

Other Software of Developer Gora Khargosh

Comments to Watchdog

Comments not found
Add Comment
Turn on images!