gpt4 book ai didi

c++ - windows删除文件需要哪些权限

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:39:48 24 4
gpt4 key购买 nike

在 CreateFile() 中有 GENERIC_READ、GENERIC_WRITE、FILE_READ_ATTRIBUTES 等 DesiredAccess

我的问题是,仅删除系统中的文件所需的最低/确切权限是多少?

谢谢

最佳答案

如果你只想删除一个文件,使用DeleteFile功能。

它的文档详细说明了您需要什么权限,以及一些您应该知道的事情,例如:

If you request delete permission at the time you create a file, you can delete or rename the file with that handle, but not with any other handle.

该文档页面中有很好的信息,包括指向 File Security and Access Rights 的链接.

查看ACCESS_MASKOpenFile 文档页面链接的实际删除访问权限标志的页面 - 它简称为 DELETE

但要提醒一句:这种类型的支票总是很活泼。文件权限可以在您的访问权限检查和后续删除之间更改。 ( Time of check/time of use .)

关于c++ - windows删除文件需要哪些权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6007463/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com