<s> import pyinotify <EOL> wm = pyinotify . WatchManager ( ) <EOL> mask = pyinotify . IN_DELETE | pyinotify . IN_CREATE <EOL> class EventHandler ( pyinotify . ProcessEvent ) : <EOL> def process_IN_CREATE ( self , event ) : <EOL> print "<STR_LIT>" , event . pathname <EOL> def process_IN_DELETE ( self , event ) : <EOL> print "<STR_LIT>" , event . pathname <EOL> handler = EventHandler ( ) <EOL> notifier = pyinotify . Notifier ( wm , handler ) <EOL> wdd = wm . add_watch ( '<STR_LIT>' , mask , rec = True ) <EOL> notifier . loop ( ) </s>
