Hi List,
this is my first posting to the List but I'm not sure if this List is the correct one.
I'm using the new FSEventStream API of Leopard, to monitor changes in some directories. First I had to monitor only one directory and everything worked fine but now I have to monitor another additional directory and now Starting the Event Stream results in the following error:
(CarbonCore.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
I'm using the following code, to setup the FSEventStream:
const void *paths[3] = { CFStringCreateWithCString(NULL, aslfContext->cachePath, kCFStringEncodingASCII), CFStringCreateWithCString(NULL, aslfContext->licensePath, kCFStringEncodingASCII), NULL };
CFArrayRef pathsToWatch = CFArrayCreate(NULL, paths, 2, NULL); CFAbsoluteTime latency = 3.0; /* Latency in seconds */
FSEventStreamEventId eventID = kFSEventStreamEventIdSinceNow;
struct stat licensePathStatus; stat(licensePath, &licensePathStatus); dev_t device = licensePathStatus.st_dev; aslfContext->stream = FSEventStreamCreateRelativeToDevice(NULL, &CheatAttempt, callbackInfo, device, pathsToWatch, eventID, latency, kFSEventStreamCreateFlagNone); FSEventStreamScheduleWithRunLoop(aslfContext->stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); FSEventStreamStart(aslfContext->stream);
The code above doesn't work. But if I change the line: CFArrayRef pathsToWatch = CFArrayCreate(NULL, paths, 2, NULL);
to
CFArrayRef pathsToWatch = CFArrayCreate(NULL, paths, 1, NULL);
It works flawlessly. But with just one directory.
Any Ideas?
regards Joachim
|