fanotify is intended to provide an interface for on access file scanning and permissions gating based on the results of those scans.
fanotify, built on top of fsnotify, is supposed to replace inotify which replaced dnotify. Are there some good programming examples …
linux inotify fanotify