Why does WatchService generate so many operations?
问题 import java.io.*; import java.nio.file.*; public class Tmp { public static void main(String [] args) throws IOException { int count = 0; Path path = Paths.get("C:\\tmp\\"); WatchService ws = null; try { ws = FileSystems.getDefault().newWatchService(); path.register(ws, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.OVERFLOW); } catch (IOException ioe) { ioe.printStackTrace(); } while(true) { WatchKey