Re: File remains in use after calling close



have you closed the connection that opened the FileInputStream?

dmitryr@xxxxxxxxx wrote:
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.


-- http://lloyd-duke.net + news AT website.domain .



Relevant Pages

  • File remains in use after calling close
    ... FileInputStream() and then close this stream, and then try to delete or ... rename it OS Windows reports: ... It happens only after several open/close cycles. ... Stream closing happens in finally so can't be bypassed. ...
    (comp.lang.java.programmer)
  • Re: File remains in use after calling close
    ... > I observed very strange problem, when I open a file using new ... > FileInputStream() and then close this stream, and then try to delete or ... > It happens only after several open/close cycles. ... > Stream closing happens in finally so can't be bypassed. ...
    (comp.lang.java.programmer)