I never thought this would happen to me, but I ran into the first error in Java:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5003595
I am pretty much in the same situation as described in the error (NFS on linux), and I see that File.exists () does not return the correct value (at least not right away).
So my question is: is there an alternative to this method of checking for a file? I would prefer it to be OS agnostic, if possible.
EDIT: I found a workaround. If you call "ls $ filedir", NFS updates all caches / metadata that cause Java problems, and File.exists () returns the correct value. Of course, this is not entirely ideal, since it harms portability, but there are ways to deal with this problem.
Thanks, Ben
java file-io
Ben
source share