• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
FSEventStream with more than one Path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FSEventStream with more than one Path


  • Subject: FSEventStream with more than one Path
  • From: Joachim Deelen <email@hidden>
  • Date: Mon, 11 Feb 2008 19:08:01 +0100

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


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: FSEventStream with more than one Path
      • From: Joachim Deelen <email@hidden>
  • Prev by Date: Trouble updating a complex software solution
  • Next by Date: Re: FSEventStream with more than one Path
  • Previous by thread: Re: Trouble updating a complex software solution
  • Next by thread: Re: FSEventStream with more than one Path
  • Index(es):
    • Date
    • Thread