VirtualFile.refresh(false, false) doesn't always work?

Shouldn't VirtualFile.refresh(false, false) cause all changes to the
file to be re-read from the filesystem? Is there any caching done here?
I'm calling Runtime.exec to chmod a file +w, then calling refresh, then
doing some VCS actions on it. However, about half the time, the refresh
appears to not work, and file.isWritable() remains false, even when I
step through in debugger and verify on command line that the file is
indeed +w when refresh() is called.

Has anyone else experienced this problem?

1 comment

I think the problem might have been that I didn't call waitFor() on the
process calling chmod. Now I use the ReadyonlyStatusUtil anyway, and it
seems to work now.

Keith Lea wrote:

Shouldn't VirtualFile.refresh(false, false) cause all changes to the
file to be re-read from the filesystem? Is there any caching done here?
I'm calling Runtime.exec to chmod a file +w, then calling refresh, then
doing some VCS actions on it. However, about half the time, the refresh
appears to not work, and file.isWritable() remains false, even when I
step through in debugger and verify on command line that the file is
indeed +w when refresh() is called.

Has anyone else experienced this problem?

0

Please sign in to leave a comment.