Possible to force file lock release?
843811Mar 30 2004 — edited Apr 2 2004Is there any way to force the JVM to release a lock on a certain file?
I am reading from a BufferedReader wrapped around a FileReader. At some point, an IOException is thrown (I'm reading a file that is being written by another process, and occaisonally this will happen, but I'm handling it so it doesn't really bother me). When this happens, I can not call reader.close(), the lock never gets released, and I can never delete the file I was reading from.
So I'm wondering if there is some way to force it to be unlocked. Ideally a static method like
FileLock.releaseLock(File pleaseReleaseMeLetMeGo)
?????