• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Personal Java File IO

 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're haivng some trouble deleting files under Personal Java. Specifically, when we call the delete method of File, we get one of two problems, it returns true, but does not delete the file, or it throws an exception, and the file gets corrupted. Anyone else have this problem?
My other thought is that maybe we have another reference to the file object. What happens if you have two references to a file, and try to delete the file form one of them? (I realize this is probably a general java topic, so move it if appropriate.)
--Mark
hershey@eyeshake.com
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turned out to be we just had an extra reference to the file which needed to be removed. Interestingly, we removed the reference after we called the deleted method. I suspect it simply needs to be removed before the gc actually runs; at the veyr least before some type of JVM file deletion cleanup code runs.
--Mark
hershey@vaultus.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic