---

Monitor Linux file system events with inotify

“I am indebted to Eli Dow of IBM who wrote an earlier version of
this article, prior to the final integration of inotify in the
Linux kernel. In particular, the sample code available in the
Download section is still based heavily on Eli’s original sample
code.

“Introducing inotify

“File system event monitoring is essential for many types of
programs ranging from file managers to security tools. Since the
Linux 2.6.13 kernel, Linux has included inotify, which allows a
monitoring program to open a single file descriptor and watch one
or more files or directories for a specified set of events, such as
open, close, move/rename, delete, create or change attributes. Some
enhancements have been made in later kernels, so check your kernel
level before depending on those features.

“In this article, you will learn how to use inotify functions
for a simple monitoring application. Download the sample code and
compile it on your system to explore further.”


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis