我不得不帮助某人删除一个文件夹,其中包含奇怪的字符,导致路径被重新插入为不同的路径:
c:\test. -> c:\test
我花了一段时间才想起 \\?\
结构,因为我不知道它叫什么或如何搜索它。不过,一旦我记住了它,就很容易了:
\\?\c:\test. -> c:\test.
这个构造的名称是什么,我(和其他人)可以搜索它吗?
最佳答案
我认为它没有广泛使用的官方名称,所以我怀疑您在任何搜索中都无法取得很大进展。此处描述:https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247.aspx#maxpath
The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".
对于这种用法,它可能被称为扩展长度路径前缀。然而,前缀还有其他用途,最具体的是抑制用户模式路径规范化,这是您利用自己的目的。
从这个答案的评论中可以看出,对于最合适的名称有很多不同的意见。我想我们都同意,这个东西没有一个正式使用的名称!
关于windows - Windows 中 "\\?\"构造的名称是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28568211/