File remains in use after calling close
- From: dmitryr@xxxxxxxxx
- Date: 29 Apr 2005 18:58:33 -0700
I observed very strange problem, when I open a file using new
FileInputStream() and then close this stream, and then try to delete or
rename it OS Windows reports:
The process cannot access the file because it is being used by another
process.
It happens only after several open/close cycles.
Stream closing happens in finally so can't be bypassed. For surety I've
added counter of all open/close and it remains 0. Is any debug methods
how to figure which object in Java keeps a stream opened? One more
detail, a stream can be obtained using connection getInputStream,
however it get closed anyway.
.
- Follow-Ups:
- Re: File remains in use after calling close
- From: Lloyd Duke
- Re: File remains in use after calling close
- Prev by Date: Re: the right way to kill a java thread on Windows?
- Next by Date: Re: Using Reflection to get all Classes?
- Previous by thread: the right way to kill a java thread on Windows?
- Next by thread: Re: File remains in use after calling close
- Index(es):
Relevant Pages
|
|