PDA

View Full Version : Directory change as script trigger?



dewarrn1
August 9th, 2005, 07:43 PM
Hi all. I'd like to fire a script when the contents of a directory change. I've googled a bit and come up with some kludgey stuff, but I was wondering whether there was an easier way. Under Windows, I could use a Python API to catch system signals from MS ReadDirectoryChanges or MS FindFirstChangeNotification. Examples: http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html
Currently, I'm just running the script as a cron job every so often, but that seems kind of wasteful. Anyway, thanks for any help.

tomchuk
August 9th, 2005, 11:11 PM
python2.4-gamin in universe will do what you need, if python is your thing.