WatchKey#PollEvents() returning more events than expected
Alan.Bateman at Sun.COM
Sun Jul 13 09:11:50 PDT 2008
Tony Childs wrote:
> Thank you for your help. I don't know how I missed note about
> ENTRY_MODIFY in the Javadoc.
> Regarding my second issue, I am creating the file using Windows (XP)
> Explorer (File-->New-->Text Document). I'm guessing this is an OS
> behavior as well.
Windows Explorer initially creates a file named "New Text Document.txt"
or some such before you name the file so this should explain the
sequence of events you observe. To verify this you could try the
WatchDir sample in the %JDK_HOME%\sample\nio\file directory as it prints
the context for each event. As Umashankar suggested, you can also
observe "unexpected" events on other platforms where editors create foo~
or other backup/temporary files.
More information about the nio-discuss