pyinotify: monitor filesystem events with Python under Linux Source
Markdown source
1---2title: 'pyinotify: monitor filesystem events with Python under Linux'3date: '2007-05-03'4published_at: '2007-05-03T16:18:00.001+10:00'5tags: ['code', 'linux', 'python']6author: 'Gavin Jackson'7excerpt: 'Dan at work put me on to some new Linux Kernel functionality in the form of inotify - the userland tools and libraries allow you to hook into this pretty handy capability. It essentially allows you to...'8updated_at: '2007-05-03T19:00:24.976+10:00'9legacy_url: 'http://www.gavinj.net/2007/05/pyinotify.html'10---1112Dan at work put me on to some new Linux Kernel functionality in the form of inotify - the userland tools and libraries allow you to hook into this pretty handy capability.1314It essentially allows you to watch for events on the filesystem - including creation, modification and deletion of files (this is a replacement and enhancement of the older dnotify system).1516The python library can be found at [http://pyinotify.sourceforge.net/ ](http://pyinotify.sourceforge.net/)(just ensure you have build-essential and python2.4-dev installed).1718I'm going to use this system to automatically perform postprocessing on uploaded files as soon as they arrive (including virus scanning, keyword indexing and possibly encryption/other sanitisation).192021