Supporting Long File Names and UNC
Microsoft Windows NT and Windows 95 now provide the capability to incorporate long file names in system administration and application development, and support the universal naming convention (UNC) for seamless integration in networking environments.
Long File Names
Long file names significantly expand and increase the 32-bit Windows operating system functionality that previously was limited by the 8.3 file name length restriction of the older 16-bit Windows operating system.
The following general guidelines apply to all file systems supported within the Windows operating system. An application that follows these guidelines can create valid names for files and directories regardless of the file system in use:
-
Use any character in the current code page for a name, but not a path separator, a character in the range 0 through 31, or any character disallowed by the file system. A name can contain characters in the extended character set (128–255).
-
Use the backslash (\) and/or the forward slash (/) to separate components in a path.
-
Use a period (.) as a directory component in a path to represent the current directory and to separate components in a directory name or file name.
-
Use two consecutive periods (..) as a directory component in a path to represent the parent of the current directory.
-
Do not use the following characters in directory names or file names, because they are reserved for Windows: < > : " / \ |
-
Do not use reserved words, such as aux, con, and prn, as file names or directory names.
-
Process a path as a null-terminated string. The maximum length for a path is given by MAX_PATH. The Unicode versions of the CreateDirectory, FindFirstFile, GetFileAttributes, and SetFileAttributes functions allow paths to exceed the MAX_PATH length if the path has the \\?\ or \\?\UNC\ prefix. These prefixes turn off path parsing. Use the \\?\ prefix with paths for local storage devices and the \\?\UNC\ prefix with paths using the UNC format. An example of a UNC path is \\machine\sharename.
-
Do not assume case sensitivity, because not all file systems distinguish between cases.
Universal Naming Convention
Supporting the UNC paths when dealing with file names is another way for an application to work seamlessly in a network environment. UNC paths allow logical connections to network devices without the need to specifically reference a network drive letter. The system will be able to locate the network server and path with the UNC name even over a modem connection. The UNC describes network servers and share points on those servers. UNC names start with two backslashes followed by the server name. All other fields in the name are separated by a single backslash.