Dirwatcher monitors a given directory for events using the inotify API of Linux. When a file is created, deleted, opened or closed, dirwatcher receives an event and dispatches it to a high-level module. High-level modules register a directory handler with dirwatcher, which specifies the directory and events to watch.