You can watch the IN_MOVED_TO
event:
mask = pyinotify.IN_CREATE | pyinotify.IN_MOVED_TO
class PTmp(pyinotify.ProcessEvent):
...
def process_IN_MOVED_TO(self, event):
print "Moved: %s " % os.path.join(event.path, event.name)
event_log = open('/home/saad/Code/test/event_log', 'a')
event_log.write(event.name + ' - ' + timestamp.strftime('%c') + '\n')
event_log.close()
(Not tested as I don't have a Linux box available right now).
A full list of inotify events is available in the man page or in the pyinotify doc.