Inotify

Uses your system voice; voice and rate in settings.

Snapshot

≈ 4 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

inotify (inode notify) is a Linux kernel subsystem created by John McCutchan, which monitors changes to the filesystem, and reports those changes to applications. It can be used to automatically update directory views, reload configuration files, log changes, backup, synchronize, and upload. The inotifywait and inotifywatch commands (maintained by Eric Curtin as part of the inotify-tools project) allow using the inotify subsystem from the command line. One major use is in desktop search utilities like Beagle, where its functionality permits reindexing of changed files without scanning the filesystem for changes every few minutes, which would be very inefficient. inotify replaced an earlier facility, dnotify, which had similar goals. Inotify was merged into the Linux kernel mainline in kernel version 2.6.13, released on August 29, 2005; later kernel versions included further improvements. The required library interfaces were added into the GNU C Library (glibc) in its version 2.4, released in March 20061, while the support for inotify was completed in glibc version 2.5, released in September 2006.

inotify (inode notify) is a Linux kernel subsystem created by John McCutchan, which monitors changes to the filesystem, and reports those changes to applications. It can be used to automatically update directory views, reload configuration files, log changes, backup, synchronize, and upload. The inotifywait and inotifywatch commands (maintained by Eric Curtin as part of the inotify-tools project) allow using the inotify subsystem from the command line. One major use is in desktop search utilities like Beagle, where its functionality permits reindexing of changed files without scanning the filesystem for changes every few minutes, which would be very inefficient. inotify replaced an earlier facility, dnotify, which had similar goals. Inotify was merged into the Linux kernel mainline in kernel version 2.6.13, released on August 29, 2005; later kernel versions included further improvements. The required library interfaces were added into the GNU C Library (glibc) in its version 2.4, released in March 2006, while the support for inotify was completed in glibc version 2.5, released in September 2006.

Advantages over dnotify

There are a number of advantages when using inotify when compared to the older dnotify API that it replaced. With dnotify, a program had to use one file descriptor for each directory that it was monitoring. This can become a bottleneck since the limit of file descriptors per process could be reached. Later, fanotify was created to overcome this issue. The use of file descriptors along with dnotify also proved to be a problem when using removable media. Devices could not be unmounted since file descriptors kept the resource busy. Another drawback of dnotify is the level of granularity, since programmers can only monitor changes at the directory level. To access detailed information about the environmental changes that occur when a notification message is sent, a stat structure must be used; this is considered a necessary evil in that a cache of stat structures has to be maintained, for every new stat structure generated a comparison is run against the cached one. The inotify API uses fewer file descriptors, allowing programmers to use the established select and poll interface, rather than the signal notification system used by dnotify. This also makes integration with existing select- or poll-based libraries (like GLib) easier.

References

IBM Article monitoring Linux filesystem events with inotify (6 September 2008). Filesystem notification, part 1: An overview of dnotify and inotify an LWN.net article by Michael Kerrisk (2014)

Text derived from https://en.wikipedia.org/w/index.php?oldid=1362915615 under CC BY-SA 4.0; modifications have been made.

References

1 claim could not be tied to a specific sentence and is listed in the table below instead.

  1. ↩Wikipedia release date (×1) · confidence 0.95 https://en.wikipedia.org/w/index.php?oldid=1362915615

Provenance

snapshot enwiki-001362915615 · captured 1783375470.0 · version history

Cite this page as: encyclopegia.org, “Inotify”, snapshot enwiki-001362915615. https://encyclopegia.org/a/inotify

Sources cited in this revision

Extracted from the cited revision's reference blocks; absent citations are not invented.