I've written code that used a facility called FAM, which stands for something like File Access (or Activity? Alteration?) Monitor. There's also dnotify, though that may have morphed into the inotify tool mentioned previously. FAM and dnotify could monitor specific files as well as all files in a directory.