![]() It does not have any relationship with other events on other disks, and thus you must create a separate event stream for each physical device that you wish to monitor. Any new events will automatically start after the highest-numbered historical ID for any attached drive.Ī per-disk event stream, by contrast, consists of events whose IDs are increasing with respect to previous events on that disk. These IDs are guaranteed to be unique with one exception: if additional disks are added from another computer that was also running OS X v10.5 or later, historical IDs may conflict between these volumes. You can create these streams by calling the functions FSEventStreamCreate and FSEventStreamCreateRelativeToDevice, respectively.Ī per-host event stream consists of events whose IDs are increasing with respect to other events on that host. Before you can create a stream, you must decide which type of stream to create: a per-host event stream or a per-disk event stream. The file system events API supports two types of event streams: per-disk event streams and a per-host event streams. When you compile, you must include the Core Services Framework by adding it to your target in Xcode or by adding the flag -framework CoreServices to your linker flags on the command line or in a Makefile. Adding Include Directivesīefore you use the file system event stream API, you must include the Core Services framework as follows: These steps are explained in more detail in the sections that follow. The application releases its reference to the stream by calling FSEventStreamRelease. The application invalidates the stream by calling FSEventStreamInvalidate. The application unschedules the event from its run loop by calling FSEventStreamUnscheduleFromRunLoop. If the application needs to restart the stream, go to step 3. The application tells the daemon to stop sending events by calling FSEventStreamStop. ![]() The API posts events by calling the callback function specified in step 1. The application services events as they arrive. The application tells the file system events daemon to start sending events by calling FSEventStreamStart. The application schedules the stream on the run loop by calling FSEventStreamScheduleWithRunLoop. The application creates a stream by calling FSEventStreamCreate or FSEventStreamCreateRelativeToDevice. ![]() The life cycle of a file system events stream is as follows: You can create a new event stream, perform operations on the stream, and so on using functions that begin with FSEventStream. You can obtain general information about volumes and events by using functions that begin with FSEvents. The File System Events API consists of several distinct groups of functions. Next Previous Using the File System Events API ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |