site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com $ ulimit -n 256 $ sysctl kern.maxfiles kern.maxfiles = 12288 $ sysctl kern.maxfilesperproc kern.maxfilesperproc = 10240 [etc] Cheers, Ian _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Thu, 12 Oct 2006, maurits wrote: is there a limit on the number of files one can simultaneously monitor with the kevent mechanism? There are several limits on the number of files you can have open, which they have to be to be able to watch them with EVFILT_VNODE. 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 :-) This email sent to site_archiver@lists.apple.com