bdkjones/VDKQueue

addPath: notifyingAbout Flag Issue

saulpower opened this issue · 2 comments

I'm using VDKQueue on OS X 10.7.3 in xCode 4.2 and I get a "Use of Undeclared Identifier" error on VDKQueueNotifyDefault when I try to run the following code:

VDKQueue* kqueue = [[VDKQueue alloc] init];
[kqueue addPath:@"/path/to/directory/" notifyingAbout:VDKQueueNotifyDefault];

It's actually providing undeclared identifier errors on all the u_int flags in VDKQueue.h. When I call just the "addPath" method everything works fine.

The defines for the events in VDKQueue.h are directly mapped to the defines used by the OS X kernel itself. In order to use them, you need to add this line to the top of any class where you do:

#include <sys/event.h>

That will resolve the undefined errors. Also, there's no reason to use the -notifyingAbout method unless you're going to use the default event set. The -addPath: method uses the default event set, so you can simply use that method instead.

I will update the comments in the header to make this clear; as there's currently no mention of it.