gpt4 book ai didi

windows - 使用 Share-Delete 打开文件是否允许其他人写入?

转载 作者:可可西里 更新时间:2023-11-01 10:39:31 25 4
gpt4 key购买 nike

FileShare 枚举提供各种标志,例如读取、写入、删除...。通常我会认为共享文件删除只允许删除而不能做其他事情(比如阅读)。

但是,我依稀记得 Windows 只区分文件的只读访问权限和完全访问权限,因此实际上为删除而共享也允许写入文件。遗憾的是,这是很多年前的事了,我既没有找到原始来源,也没有找到任何相关信息。是否有关于实际行为的可靠规范?它取决于操作系统还是 FS?

最佳答案

查看 CreateFile Function 的文档.

FILE_SHARE_DELETE: Enables subsequent open operations on a file or device to request delete access. Otherwise, other processes cannot open the file or device if they request delete access. If this flag is not specified, but the file or device has been opened for delete access, the function fails. Note Delete access allows both delete and rename operations.

文档没有提到也允许读取访问权限。

关于windows - 使用 Share-Delete 打开文件是否允许其他人写入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6999671/

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