SCEvents 0.1.1

Just a quick update to SCEvents that I released a couple of weeks ago. The new feature in this release gives you the ability to specify particular directories that are sub-directories of the paths that your client application has registered to watch and ignore events that come from them. For example, if you register your client application to be notified of all events that occur under the current user's home directory but you wish to ignore those events that come from their Downloads directory then you simply tell SCEvents to ignore them:

SCEvents *events = [SCEvents sharedPathWatcher];

[events setDelegate:self];

NSMutableArray *paths = [NSMutableArray array];
NSMutableArray *excludePaths = [NSMutableArray array];

[paths addObject:NSHomeDirectory()];
[excludePaths addObject:[NSHomeDirectory() stringByAppendingString:@"/Downloads"]];

[events setExcludedPaths:excludePaths];
[events startWatchingPaths:paths];

One other change that has been made is the removal of the trailing slash on all event paths that are provided to the client application. FSEvents provides the event paths with a trailing slash presumably to indicate that the event originated from within that directory but the removal of them enables SCEvents to provide the above functionality of ignoring events from particular directories. Therefore, client applications that register to ignore directories should provide their paths with no trailing slash.

Also, one thing I forgot to mention when I originally released the code was that your project will have to be linked against the Core Services framework which provides access to the FSEvents API. You can do this by adding the framework to your project, it is located at:


Please also be aware that the sample project included in the source was created in Xcode 3.1 beta and probably won't work in any other version. To get around this simply create a new project and include the source files. The addition of this new functionality was the direct result of feedback based on usage so please keep it coming.

Posted May 17th, 2008