Isn't this the kind of thing that FAM was invented for?
http://oss.sgi.com/projects/fam/ http://en.wikipedia.org/wiki/File_alteration_monitor
(Or specific things like inotify on Linux: http://en.wikipedia.org/wiki/Inotify )
http://oss.sgi.com/projects/fam/ http://en.wikipedia.org/wiki/File_alteration_monitor
(Or specific things like inotify on Linux: http://en.wikipedia.org/wiki/Inotify )