[Mono-osx] An open letter to the OS X Mono group.

Miguel de Icaza miguel at novell.com
Sat Apr 7 15:07:11 EDT 2007


Hello,

> My findings seemed to indicate that the root of these problems was  
> deeper than the firing of the managed events: Using test code I  
> shared with Geoff a change to a file (length, contents, last write)  
> did not trigger a kevent event on the directory's file descriptor. I  
> would be fine with a solution like in my test implementation where I  
> determine whether a directory or a single file should be monitored  
> and then use the respective file descriptor for kevent.
> 
> The remaining problem then is: How do we handle wildcards? Currently  
> we have a 1:1 mapping of FileSystemWatchers to file descriptors. But  
> what if a user wants to monitor a directory with hundreds of files?  
> The commented out part of my test implementation shows that we are  
> limited to 255 open file descriptors in whole. According to my  
> reading this is what Linux software like inotify and the like handle  
> - but nothing comparable seems to be available for OS X except some  
> hacky ways of accessing the undocumented internals of Tiger's  
> Spotlight engine. And Finder's FSNotify seems to be an even worse way  
> of detecting changes. So kevent seems to be our best bet for now -  
> it's just the question of how to use it.

One potential alternative is to force the use of the "polling"
implementation, an implementation that basically scans directories
constantly to check for changes and updates on MacOS X.

Not ideal, but it might be slightly better than this.


More information about the Mono-osx mailing list