Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Using the File System Events API

The File System Events API consists of several distinct groups of functions. You can obtain general information about volumes and events by using functions that begin with FSEvents. You can create a new event stream, perform operations on the stream, and so on using functions that begin with FSEventStream.

The life cycle of a file system events stream is as follows:

  1. The application creates a stream by calling FSEventStreamCreate or FSEventStreamCreateRelativeToDevice. The stream initially has a retain count of 1. If desired, you can increment this count by calling FSEventStreamRetain.

  2. The application schedules the stream on the run loop by calling FSEventStreamScheduleWithRunLoop.

  3. The application tells the file system events daemon to start sending events by calling FSEventStreamStart.

  4. The application services events as they arrive. The API posts events by calling the callback function specified in step 1.

  5. The application tells the daemon to stop sending events by calling FSEventStreamStop.

  6. If the application needs to restart the stream, go to step 3.

  7. The application unschedules the event from its run loop by calling FSEventStreamUnscheduleFromRunLoop.

  8. The application invalidates the stream by calling FSEventStreamInvalidate.

  9. The application releases its reference to the stream by calling FSEventStreamRelease.

These steps are explained in more detail in the sections that follow.

Contents:

Adding Include Directives
Creating an Event Stream
Handling Events
Using Persistent Events
Building a Directory Hierarchy Snapshot
Cleaning Up
Special Considerations for Per-Device Streams




< Previous PageNext Page > Hide TOC


Last updated: 2008-03-11




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice