October 2018
Intermediate to advanced
420 pages
10h 26m
English
The name inotify is a contraction of inode notify. Inodes are the names of the filesystem on a Unix system. So files and directories are implemented as inodes in Linux (as well as on macOS since it implements a lot of Unix features). The inotify API is very simple, and is composed of just three functions. These APIs are system calls, accessible via C APIs in the GNU C standard library:
When an application needs to monitor a directory or a file, it must first create a monitoring context. This is done with the inotify_init function. This function returns a file descriptor. Then, to actually monitor a file, the inotify_add_watch function must be called. This function takes ...