In CreateFile() has DesiredAccess Like GENERIC_READ, GENERIC_WRITE, FILE_READ_ATTRIBUTES, etc.
My question is what is the minimum/exact permissions needed to solely delete a file in the system?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you just want to delete a file, use the
DeleteFilefunction.It’s documentation details what permissions you need, and a few things you should know, like:
There is good information in that documentation page, including a link to File Security and Access Rights.
Look at the
ACCESS_MASKpage linked from theOpenFiledocumentation page for the actual delete access right flag – it’s simply calledDELETE.But a word of warning: this type of check is always racy. The file permissions can change between your access right check and a subsequent delete. (Time of check/time of use.)