什么是最小有效UNC路径? [英] What is a minimal valid UNC path?
问题描述
我想建立一个可以解析UNC路径的库,但是我对语法没有完全的了解.
I want to make a library that (among other things) parses UNC paths, but I don't fully understand the grammar.
常见示例为:\\server\share\path
所有这些都是有效文件路径所必需的吗?我可以使用Windows资源管理器导航到\\server
(没有share
),但是我假设它正在使用某些共享发现协议,而文件系统API无法理解某些内容–是吗?
Are all of those required for a valid file path? I can navigate to \\server
(without share
) using Windows Explorer, but I assume it is using some share discovery protocol, not something filesystem APIs understand — is this right?
推荐答案
您是正确的.必须具有共享名称部分的UNC路径.
You are correct. A UNC path is required to have share name component.
引用MSDN:
UNC = \\<hostname>\<sharename>[\<objectname>]*
<hostname>
,<sharename>
和<objectname>
被称为路径名组件"或路径组件".有效的UNC路径由两个或多个路径组成.
The <hostname>
, <sharename>
, and <objectname>
are referred to as "pathname components" or "path components". A valid UNC path consists of two or more path components.
https://msdn.microsoft.com/en-us/library/gg465305.aspx
这篇关于什么是最小有效UNC路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!