O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

fseventsd

Rather than having multiple programs listening to /dev/fsevents, OS X introduces a daemon, fseventsd, that reads from the device, as shown in Figure 16.3. fseventsd coalesces the change stream into fewer events and then notifies other programs that have registered an interest in particular directories. Apple provides an API that talks to fseventsd under the hood and feeds you file system changes via a callback function whenever an interesting event happens.

Figure 16.3  fseventsd notifying a file system change

fseventsd notifying a file system change

You will not be able to get events in absolutely real time because of this intermediary daemon. This is fine for most applications, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required