View Single Post
  #4 (permalink)  
Old 01-25-2008, 04:40 AM
CaptainMorgan's Avatar
CaptainMorgan CaptainMorgan is offline
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Quote:
Originally Posted by ravian View Post
Thanks but it only works if file is not being used. I have a Java thread that is writing to the text file. The second thread tries to delete the file. Is it possible?
Hmm.... it's my understanding that it might not be able to delete a file that is being used - that's just plain OS/Software fundamentals. Ever try deleting your Word or Open Office document that's currently open? You get a lovely popup message saying "you must close this file before you can delete it"... or something to that effect. But maybe there is a way in Java... maybe someone knows. What we do know, is that even though you have two threads, at some point the thread using the file will eventually stop using the file, unless you've implemented an infinite loop into the program.... interesting question nevertheless.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Reply With Quote