Basically, I want to monitor if a file has changed, for
potentially hundreds or even thousands of files. The code I have (based on
Michael McCracken's stakeout) seems to be able to monitor no more than 251
files (weird number, I don't have a clue why).
Because the default resource limit is 256 open files, and you have a few
things such as stdin/out/err and the kqueue open, as well as all the files
you're trying to monitor.
You can increase the resource limit to kern.maxfilesperproc, which might
be "good enough" for your purposes.
Is there a limitation? Is it
even sensible to monitor so many files simultaneously using the kevent
mechanism?
I don't think so, mostly because it's not sensible to have so many files
open in order to be able to monitor them. I think there are non-portable
ways to do this at higher levels (e.g. the way Spotlight and Time Machine
watch huge chunks of the filesystem), but I don't know them. Try some
filesystem doc, or wait for somebody more knowledgeable to provide a
better answer :-)
Cheers,
Ian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden