\\?\放在文件路径前是什么意思 [英] What does \\?\ mean when prepended to a file path

查看:1342
本文介绍了\\?\放在文件路径前是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在日志中找到了对文件的引用,该文件的格式如下:

I found a reference to a file in a log that had the following format:

\\?\C:\Path\path\file.log

我找不到对\?\序列的含义的引用.我相信反斜杠之间的部分是指主机名.

I cannot find a reference to what the sequence of \?\ means. I believe the part between the backslashes refers to a hostname.

例如,在我的Windows计算机上,以下各项工作正常:

For instance, on my Windows computer, the following works just fine:

dir \\?\C:\

而且,结果也很好:

dir \\.\C:\

问题:

  1. 在这种特殊的路径格式中是否存在问号的含义?
  2. 什么会生成这种格式的文件路径?

推荐答案

长期阅读,但如果您在此域中,则值得阅读:http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx

A long read, but worth reading if you are in this domain: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx

提取:

Windows API具有许多功能,这些功能还具有Unicode版本,以 允许使用扩展长度的路径,最大总路径长度为 32,767个字符.这种类型的路径由组件组成 用反斜杠分隔,每个反斜杠最多等于 GetVolumeInformationlpMaximumComponentLength参数 功能(此值通常为255个字符).指定一个 扩展长度路径,请使用"\\?\"前缀.例如,"\\?\D:\very long path".

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".

和:

"\\?\"前缀也可以与根据以下内容构造的路径一起使用 通用命名约定(UNC).要指定这样的路径,请使用 UNC,使用"\\?\UNC\"前缀.例如,"\\?\UNC\server\share", 其中"server"是计算机的名称,而"share"是计算机的名称 共享文件夹.这些前缀不用作路径的一部分 本身.它们指示路径应传递到系统 进行最少的修改,这意味着您不能使用正向 以斜线表示路径分隔符,或以句号表示 当前目录,或双点代表父目录. 由于您不能将"\\?\"前缀与相对路径一起使用, 相对路径始终限制为总共MAX_PATH个字符.

The "\\?\" prefix can also be used with paths constructed according to the universal naming convention (UNC). To specify such a path using UNC, use the "\\?\UNC\" prefix. For example, "\\?\UNC\server\share", where "server" is the name of the computer and "share" is the name of the shared folder. These prefixes are not used as part of the path itself. They indicate that the path should be passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory, or double dots to represent the parent directory. Because you cannot use the "\\?\" prefix with a relative path, relative paths are always limited to a total of MAX_PATH characters.

这篇关于\\?\放在文件路径前是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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