« Simple way of sharing files on a home networkAutomatically showing the Editor's file in Eclipse's Package Explorer »

4 comments

Comment from: Tony [Visitor]
TonyThanks for this!!! I was having the exact same problem with the delete always returning false for what seemed like no good reason. Behold - the FileInputStream was still open from reading the properties file!
22/07/10 @ 19:39
Comment from: Soner [Visitor]
SonerThanks a lot for the information. This problem was driving me mad.
20/10/10 @ 12:58
Comment from: MrKnödelmann [Visitor] Email
MrKnödelmannhttp://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213298

I had the same problem with writing data to a new file and than try to renam it.
This worked for me:
try {
fos.close(); // fos is a FileOutputStream
} catch (Exception e) {}
System.gc();
try {
Thread.sleep(50);
} catch (InterruptedException e) {
}

hth

Regards
14/02/11 @ 15:42
Comment from: Fern [Visitor]
FernExcellent, because I'm having this problem right now.. I'm glad I found this.. woohoo..
Thanks a bunch..
22/07/11 @ 22:13

Leave a comment


Your email address will not be revealed on this site.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)