File watching on Oracle JDK on Mac OS X and other platforms

Alan Bateman Alan.Bateman at oracle.com
Sat Nov 2 00:50:01 PDT 2013


On 01/11/2013 16:33, Christopher Brown wrote:
> Hello,
>
> As I understand it, the file watcher service introduced with JDK 7 uses
> native (near real-time) notifications on Windows and Linux, but polling on
> Mac OS X.
>
> First off, is this correct?
>
> Second, if it is, what is the polling interval on Mac OS X (and can it be
> configured)?
>
As Dan mentioned, we do need to add a native implementation for Mac at 
some point (the original Mac port didn't have anything and the polling 
implementation is simple implementation when getting a port going or 
where the operating system doesn't have a facility).

As regards configuring the polling interval then it can be done on a per 
watched directory basis via a JDK-specific WatchEvent.Modifier, see 
com.sun.nio.file.SensitivityWatchEventModifier.

-Alan.


More information about the macosx-port-dev mailing list