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

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

问题描述

我在具有以下格式的日志中找到了对文件的引用:

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

\?C:Pathpathfile.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:

而且,同样的结果就好了:

and also, just fine with same result:

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:很长的路径".

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" 前缀.例如,"\?UNCservershare",其中 server" 是计算机的名称,share" 是计算机的名称共享文件夹.这些前缀不用作路径的一部分本身.它们表示应该将路径传递给系统修改最少,这意味着您不能使用 forward斜线表示路径分隔符,或句点表示当前目录,或双点表示父目录.因为您不能在相对路径中使用 "\?" 前缀,相对路径总是限制在 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, "\?UNCservershare", 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天全站免登陆