GNOME Bugzilla – Bug 543148
native file monitoring for os x
Last modified: 2015-08-21 03:22:56 UTC
OS X must have some native file monitoring api that we should use to avoid the poll file monitor. las almost had a heart attack when he discovered threads being created to handle the poll timeout...
If someone wans to implement it, take a look at onlhttp://developer.apple.com/documentation/Darwin/Reference/FSEvents_Ref/FSEvents/CompositePage.html Only available for 10.5+ though.
Matthias, you were talking about a 'poll file monitor'. Is this still used somewhere? With glib 2.17.7, every time I try to create a GFileMonitor I receive the error 'Unable to find default local directory monitor type'. Is there some way to work around this for now or is native support for file/directory monitoring really required? Richard, is there any specific reason why you advise the FSEvents API (and thus limiting such functionality to OS X 10.5+ users) ? I've seen OS X also supports BSD's kqueue and kevent functions, which works on OS X 10.4+ and offers all the functionality needed for the GFileMonitor to monitor files and directories
Erik, I simply didn't know about it :)
kqueue maybe? It's what poll() uses internally, which sucks precisely because each call sets up a whole new kqueue monitor to test. If gio wants to do long-term/repeated test, could set up its own kqueue once and watch it.
We have a kqueue file monitor implementation now