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

fsevents

kqueue is a wonderful tool if you want to monitor individual things, like detecting single file changes or modifications to a single folder. However, kqueue doesn’t scale well (API-wise) if you need to monitor a hierarchy of directories. To see changes to a directory hierarchy, you have to open each of the directories and subdirectories and add them to a kqueue. You also need to open any new subdirectories that are created and add them to your kqueue. Open file descriptors are a scarce resource, so you could run out of them before you run out of directories to monitor. OS X 10.5 introduced FSEvents, file system events, which will notify you if something changes in the file system as a whole, or in a particular directory hierarchy. FSEvents ...

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