Check out this article:
http://www.linuxjournal.com/article/8478
http://lwn.net/Articles/104343/
Enter "man inotify" at the Linux command line:
NAME
- inotify - monitoring file system events
DESCRIPTION
- The inotify API provides a mechanism for monitoring file system events. Inotify can be used to monitor individual files, or to monitor directories. When a directory is monitored, inotify will return events for the directory itself, and for files inside the directory.
And this article:
Documentation/filesystems/inotify.txt