• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Personal Java File IO

 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic