!7 module RecursiveFileWatchServiceSpike > DynPrintLog { File dir; bool verbose; transient bool started; start { if (dir == null) dir = javaxDataDir(); thread "Starting" { print("Starting watch service on " + dir); WatchService watchService = jdk_watchService_start(); jdk_watchService_registerRecursivePath(dir, voidfunc(File f) { if (verbose) print("File changed: " + f); vmBus_send('fileChanged, f); }); print("Listening to changes in " + dir); started = true; } } }