gpt4 book ai didi

Windows NTFS 和区分大小写

转载 作者:可可西里 更新时间:2023-11-01 14:13:33 26 4
gpt4 key购买 nike

根据 Wikipedia NTFS 允许两个大小写不同的相似名称(如 Readme.txt 与 readme.txt),并且只有 Windows 文件 API 会阻止它。

Current Windows file systems, like NTFS, are case-sensitive; that is a readme.txt and a Readme.txt can exist in the same directory. However, the API for file access in Windows applications is case-insensitive, which makes filenames case-insensitive from the application's point of view. Therefore, applications only have access to one of the files whose filenames only differ in case, and some commands may fail if the filename provided is ambiguous

我来自 Linux,我问自己这两个文件都存在并且一个人只能访问其中一个文件的可能性有多大,这使得它成为一个理想的安全问题。 “Windows API”是什么意思。还有另一种方法来访问那些重复的文件吗?是否可以直接使用磁盘驱动程序(格式化驱动程序)访问文件系统?

最佳答案

NTFS 是区分大小写的文件系统,将名称相同但大小写不同的文件视为不同的文件。

Windows API 提供了 NTFS 的抽象,使其看起来像一个保留大小写的文件系统,它通过 CreateFile 实现这一点。几乎所有文件创建和打开请求都通过 API。

即,文件打开或创建的区分大小写由传递给 CreateFile 的 FILE_FLAG_POSIX_SEMANTICS 标志调解。

关于Windows NTFS 和区分大小写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33998669/

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