Windows NTFS和区分大小写 [英] Windows NTFS and case sensitivity

查看:396
本文介绍了Windows NTFS和区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据维基百科,NTFS允许两个类似的名称与不同的情况(如Readme.txt vs 。readme.txt),它只能被Windows文件API阻止。


当前的Windows文件系统,如NTFS,区分大小写;这是一个readme.txt和一个Readme.txt可以存在于同一个目录下。但是,Windows应用程序中用于文件访问的API不区分大小写,这使得文件名从应用程序的角度来说不区分大小写。因此,应用程序只能访问其中一个文件名不同的文件,如果提供的文件名不明确,某些命令可能会失败。



<从Linux发表我问自己,这两个文件存在的可能性有哪些,只能访问其中一个文件,使其成为安全性的理想问题。什么是Windows API的意思。有另一种方式来访问这些重复的文件?我们可以使用磁盘驱动程序(格式化驱动程序)直接访问文件系统吗?

解决方案

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



Windows API提供了一个NTFS的抽象,使得它显示为保存文件系统的一种情况,通过 CreateFile API几乎所有文件创建和打开请求都通过。

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

According to Wikipedia NTFS allows two similar names with different case (like Readme.txt vs. readme.txt) and it is only prevented by the windows file 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

Comming from Linux I ask myself what are the possibilities that both files exist and one can only access one of the files making it an ideal problem for security. What is meant by "Windows API". Is there another way to access those duplicated files? Can one access the file system directly using the disk driver (format driver)?

解决方案

NTFS is a case sensitive file system and treats files with the same name, but different case, as different files.

The Windows API presents an abstraction of NTFS that makes it appear as a case preserving file system, and it does this via the CreateFile API that almost all file creation and opening requests are routed through.

Namely, the case sensitivity of file opening or creation is mediated by the FILE_FLAG_POSIX_SEMANTICS flag passed to CreateFile.

这篇关于Windows NTFS和区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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