Open lgoldstein opened 10 years ago
On Mon, Aug 4, 2014 at 3:40 PM, Lyor Goldstein notifications@github.com wrote:
I am using Java code similar to the Groovy script below in order to monitor file/directory changes (similar to tail -f). The code works fine on Windows and Linux and it used to work on OSV, but no longer. When I run it now I get:
java.io.IOException: No file descriptors available at sun.nio.fs.LinuxWatchService.
(LinuxWatchService.java:61) at sun.nio.fs.LinuxFileSystem.newWatchService(LinuxFileSystem.java:47) OpenJDK's LinuxWatchService.c uses inotify_add_watch() and friends, which in OSv are stubbed (see libc/inotify.cc), so I don't understand how this used to work. Could it be that you tried this 4 months ago, before these stubs were added?
By the way, if you just need something similar to "tail -f" on a single file, inotify is an overkill.
@nyh I don't understand how this used to work.
I am pretty sure it worked (though I may be wrong). Regardless, it does not work now (so if you wish you can change the title and remove the Regression word).
By the way, if you just need something similar to "tail -f" on a single file, inotify is an overkill
- there is no inotify in Java (which is what I am describing here...) + this bug has nothing to do with tail -f - it was just an example of where such a monitoring API is required.
Anyway, OSV is supposed to support the full Java 7 API, so it must also support this one...
I am using Java code similar to the Groovy script below in order to monitor file/directory changes (similar to tail -f). The code works fine on Windows and Linux and it used to work on OSV, but no longer. When I run it now I get:
The Groovy test script (which can easily be turned into a Java one...):