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
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.

.



Relevant Pages

  • 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)
  • Re: File remains in use after calling close
    ... FileInputStreamand 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: Welches Locale =?ISO-8859-15?Q?f=FCr_=22polnische_Proper?= =?ISO-8859-15?Q?ties=
    ... When saving properties to a stream or loading them from a stream, ... 8859-1 character encoding is used. ... public static String getString{ ... FileInputStream fileInputStream = null; ...
    (de.comp.lang.java)
  • Re: File remains in use after calling close
    ... Stream closing happens in finally so can't be bypassed. ... Windows, where I know I've closed a FileInputStream or FileOutputStream, but Windows still says it's open and can't be deleted until I exit the Java app. ...
    (comp.lang.java.programmer)
  • Re: Ridiculous readInt() bug? Read-head not advancing far enough?
    ... There really is nothing special about how the stream is created. ... FileInputStream is created and then turned to a DataInputStream. ... Prev by Date: ...
    (comp.lang.java.programmer)