I'm trying to delete a file but no matter what I try it doesn't seem to work. I set the file to read only using setReadOnly()
and then immediately check to see if I can write to it and I can. I'm using windows and I have found that there could be bugs with these methods. Is there any way to completely close a file and cut off all access to make sure I can delete it?
Asked
Active
Viewed 104 times
0

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Jeffrey Elam
- 1
- 2
-
Where the file is coming from? Are you generating it in your code? If so please provide the code. – Ivan Nevostruev Apr 11 '13 at 22:43
-
Maybe look here: http://stackoverflow.com/questions/991489/i-cant-delete-a-file-in-java – syb0rg Apr 11 '13 at 22:45