My java code is unable to delete files on the the system hard drive.
Whenever file.delete()
function is called, it returns false
.
Any ideas, why that might be happening?
File.delete()
can fail to delete a file for many reasons including:
FileOutputStream
)File.delete()
can return false
if you are trying to delete a directory that is not empty, or the named file simply doesn't exist at the time of the call.
(if there is a permission issue, a SecurityException is thrown)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With