Reputation: 5037
I have a file that can't be deleted by using File.Delete() - "Permission denied" or DeleteFile(). With the standard way it can be deleted without any problem. Using Unlocker, it showed that no handle is attached.
EDIT: The file was opened in another application. I don't know why Unlocker didn't detect it.
Upvotes: 0
Views: 544
Reputation: 54532
Look at the Parent Directory and the File's property's security tab. Verify what permissions are granted to them. This should let you know what your problem is.
Upvotes: 1
Reputation: 3999
As it says, the application running has no access to that file. If your application created that file, check if you're calling the delete with the same credentials. If your application did not create this file, it's possible it's in a location that you don't have access to.
Upvotes: 0