4 ms·
John Siracusa has a good description of OSX's equivalent. https://arstechnica.com/gadgets/2007/10/mac-os-x-10-5/7/ https://arstechnica.com/gadgets/2007/10/mac-o
by mkj 8y ago
John Siracusa has a good description of OSX's equivalent. https://arstechnica.com/gadgets/2007/10/mac-os-x-10-5/7/ https://arstechnica.com/gadgets/2007/10/mac-os-x-10-5/7/
I assume it hasn't changed too much in the past decade?
- fulafel 8y agotl;dr > The FSEvents framework relies on a single, constantly running daemon process called fseventsd that reads from /dev/fsevents and writes the events to log files on disk (stored in a .fseventsd directory at the root of the volume the events are for). That's it. > "The FSEvents framework, in turn, can only tell its clients, "Something has changed in directory /foo/bar/baz." > Clients of FSEvents are expected to then scan the directory that has changed in order to determine what, exactly, happened (assuming they're interested in that level of detail)."
- eridius 8y agoFSEvents is largely just a support infrastructure for Time Machine. Time Machine doesn't need to know about every single change, it just wants to be able to avoid having to scan the entire disk every time it goes to make a backup. This can be generalized to other backup utilities as well, or really any utility that periodically needs to check the state of the disk against some snapshot of that state. Under these conditions, "something changed in directory /foo/bar/baz" is sufficient because the directory itself can then be scanned.
- tinus_hn 8y agoJust because you don’t know other examples doesn’t mean it only exists for Time Machine. Many other things are interested in changes to the file system, for instance programs that sync a folder to a cloud service, Finder which wants to show a live view of a folder or alternative backup applications. If there was no use for this outside of Apples own apps they wouldn’t have given it a public api.
- eridius 8y agoMany things that are interested in the filesystem would use kqueue instead of FSEvents, as kqueue can give fine-grained event notices as opposed to FSEvents's course-grained "something changed in this folder".
- mkj 8y agoIf you delete a font file from disk programs using it will instantly update - emojis gone from mail.app subject lines instantly! FSEevents in action.
- eridius 8y agoThat's probably kqueue, not FSEvents.