WatchService - Exposing more of the Inotify Event Model

f m fudmail at gmail.com
Wed Sep 1 07:31:50 PDT 2010


Per Alan B.'s request, I'm moving a discussion here that was started at
http://forums.java.net/jive/thread.jspa?threadID=152825&tstart=0

I'll try to summarize.

A useful goal of the JDK7 WatchService is to provide a uniform file system
event facility across multiple operating systems. However, in some cases, it
may be more desirable to give up the portability in order to tap into the
full expressiveness of the event model of the native OS. For example,
Inotify on the Linux platform provides additional events not currently used
by the LinuxWatchService implementation such as: IN_ACCESS, IN_CLOSE_WRITE,
IN_CLOSE_NO_WRITE, and IN_OPEN.

I gave one example at the above URI where an event like IN_CLOSE_WRITE could
be used to detect and process a large file only after it has been completely
copied into a watch directory.

After looking over the internal LinuxWatchService.java source code, it
appears that the implementation could be readily used (modified or resused?)
to also provide access to these additional event types. Another event class
representation like LinuxWatchEventKinds would need to be added and used
alternatively to the StandardWatchEventKinds.

My question. Would extending the LinuxWatchService capability to optionally
expose the greater set of Inotify event types be in scope for JDK 7
development, or will client developers who desire this capability need to
find 3rd party implementations (or develop it themselves)?

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20100901/6d2b78ba/attachment.html 


More information about the nio-dev mailing list