Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Path (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Universal Naming Convention== {{Anchor|UNC}} The Microsoft '''universal naming convention''' ('''UNC'''), a.k.a. '''uniform naming convention''', a.k.a. '''network path''', specifies a syntax to describe the location of a network resource, such as a shared file, directory, or printer. A UNC path has the general form: \\ComputerName\SharedFolder\Resource Some Windows interfaces allow or require UNC syntax for [[WebDAV]] share access, rather than a URL. The UNC syntax is extended<ref>{{cite web |title=DavGetHTTPFromUNCPath function |department=WebDAV: Windows |website=[[Microsoft Docs]] |series=series |date=13 October 2021 |url=https://learn.microsoft.com/windows/win32/api/davclnt/nf-davclnt-davgethttpfromuncpath |access-date=2023-10-04}}</ref> with optional components to denote use of SSL and TCP/IP port number, a WebDAV URL of <code>http[s]://HostName[:Port]/SharedFolder/Resource</code> becomes \\HostName[@SSL][@Port]\SharedFolder\Resource When viewed remotely, the "SharedFolder" may have a name different from what a program on the server sees when opening "\SharedFolder". Instead, the SharedFolder name consists of an arbitrary name assigned to the folder when defining its "sharing". Some Windows interfaces also accept the "Long UNC": \\?\UNC\ComputerName\SharedFolder\Resource Windows uses the following types of paths: * local file system (LFS), such as <code>C:\File</code> * universal naming convention (UNC), such as <code>\\Server\Volume\File</code> or /<code><internet resource name>[\Directory name]</code> (at least in Windows 7 and later) * "long" device path such as <code>\\?\C:\File</code> or <code>\\?\UNC\Server\Volume\File</code>.<ref name="netpaths">{{cite web |title=File path formats on Windows systems |department=File and Stream I/O: .NET |website=[[Microsoft Docs]] |url=https://learn.microsoft.com/dotnet/standard/io/file-path-formats |access-date=2019-07-14}}</ref> This path points to the local file namespace and {{code|\\.\}} is a similar one that points to the local DOS device namespace. This format is also the "raw" or "uninterpreted" path, since it sends paths straight to the file system without converting {{mono|/}} to {{mono|\}} and interpreting names like {{mono|..}}.<ref name="w32paths" /> * [[Object Manager (Windows)|Windows NT object manager]] <code>\\??\</code>-prefixed paths (global DOS namespace).<ref>{{cite web |title=winapi - Is there a difference between \??\ and \\?\ paths? |website=Stack Overflow |url=https://stackoverflow.com/questions/25090101/is-there-a-difference-between-and-paths}}</ref><ref>{{cite web |title=Path prefixes \??\ and \\?\ |website=Stack Overflow |url=https://stackoverflow.com/a/46019856}}</ref> In versions of Windows prior to Windows XP, only the APIs that accept "long" device paths could accept more than 260 characters. The [[Windows shell|shell]] in [[Windows XP]] and [[Windows Vista]], [[explorer.exe]], allows path names up to 248 characters long.{{citation needed|date=February 2014}} Since UNCs start with two backslashes, and the backslash is also used for string escaping and in [[regular expression]]s, this can result in extreme cases of [[leaning toothpick syndrome]]: an escaped string for a regular expression matching a UNC begins with 8 backslashes β <code>\\\\\\\\</code> β because the string and regular expression both require escaping. This can be simplified by using [[raw string]]s, as in C#'s <code>@"\\\\"</code> or Python's <code>r'\\\\'</code>, or regular expression literals, as in Perl's <code>qr{\\\\}</code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)