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 watch for events on the filesystem - including creation, modification and deletion of files (this is a replacement and enhancement of the older dnotify system).

The python library can be found at http://pyinotify.sourceforge.net/ (just ensure you have build-essential and python2.4-dev installed).

I'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).