Forums Register Login

FIle.delete()

+Pie Number of slices to send: Send
I use windows COPY command to copy files to a folder and delete those files using java File.delete() two days later.it is successful only sometimes.
Any reason for this.?The file is not opened or used by anyone at the time of deletion.No exception .delete() returns "false".
please advise..
+Pie Number of slices to send: Send
The only thing I can think of is that you might have another object accessing the file you wish to delete.
I was having the same problem, and it turned out that an ActionListener was at fault. It had read data from the file, and the file had never been closed.
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 884 times.
Similar Threads
myFileObject.delete() doesn't
Delete Files Older than 'n' days
How to delete files reside in the server
Can't Delete File with Process
Deleting a File
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 10:10:12.