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..
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.
There's nothing more dangerous than a resourceful idiot. ---Dilbert
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad: