The FSEvents
API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
in
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
allows applications to register for notifications of changes to a given
directory tree
In computing, a directory is a file system cataloging structure that contains references to other computer files, and possibly other directories. On many computers, directories are known as folders or drawers, analogous to a workbench or the tra ...
. Whenever the filesystem is changed, the kernel passes notifications via the special
device file
In Unix-like operating systems, a device file, device node, or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These s ...
/dev/fsevents
to a
userspace
A modern computer operating system usually uses virtual memory to provide separate address spaces or regions of a single address space, called user space and kernel space. This separation primarily provides memory protection and hardware prote ...
process called
fseventsd
. This process combines multiple changes to a single directory tree that occur within a short period of time, then notifies applications that have registered for changes to the affected directory.
Until Mac OS X 10.7, FSEvents did not "watch" the filesystem, such as
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
's
inotify
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, ...
: the
API
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
provided no notifications for changes to individual files. An application was able to register to receive changes to a given directory, and had to determine for itself which file or files were changed.
Mac OS X 10.7 (Lion) added the ability to register for file modification notifications.
See also
*
inotify
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, ...
*
File Alteration Monitor
*
Spotlight (software)
Spotlight is a system-wide desktop search feature of Apple's macOS, iOS, iPadOS, and visionOS operating systems. Spotlight is a selection-based search system, which creates an index of all items and files on the system. It is designed to allo ...
References
External links
Mac OS X 10.5 Leopard: the Ars Technica review (page 7)
MacOS
{{Mac-stub