使用Share-Delete打开文件是否允许其他人写? [英] Does opening a file with Share-Delete allow others to write?

查看:115
本文介绍了使用Share-Delete打开文件是否允许其他人写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FileShare枚举提供各种标志,例如读取,写入,删除,....通常,我认为共享一个文件进行删除仅允许删除,而不能进行其他任何操作(例如读取).

The FileShare enumeration offers various flags such as Read, Write, Delete, ... . Normally I'd think that sharing a file for deletion only allows deletion but nothing else (like reading).

但是,我远程记得Windows仅区分对文件的只读访问和完全访问,因此实际上共享删除也允许写入文件.可悲的是,这是从很多年前开始的,我既没有找到原始来源也没有任何相关信息.是否有关于实际行为的可靠规范?是依赖于操作系统还是FS?

However, I remotely recall that Windows only differentiates between read-only and full access to files, so actually sharing for deletion allows writing to the file as well. Sadly this is from many years back and I neither found the original source nor any related info. Is there a reliable spec on the actual behavior? Is it dependent on the OS or the FS?

推荐答案

看看

FILE_SHARE_DELETE: 对文件或文件启用后续打开操作 设备请求删除访问权限.否则,其他进程将无法执行 如果他们要求删除访问权限,请打开文件或设备.如果这个标志是 未指定,但已打开文件或设备以进行删除 访问,功能失败.注意删除访问权限允许同时删除和删除 重命名操作.

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.

文档中没有提到也允许读取访问.

The documentation doesn't mention that read access is allowed, too.

这篇关于使用Share-Delete打开文件是否允许其他人写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆