Platform SDK: Files and I/O

Path Lengths

Path lengths may be a concern when a volume with a deep directory tree is mounted to another volume. This is because paths are concatenated by mounting. The path of a file on a mounted volume thus includes the path of the volume mount point. The globally defined constant MAX_PATH defines the maximum number of characters a path can have. You can avoid this constraint by doing both of the following:

The \\?\ turns off path parsing. By using this form, you can work with paths that are nearly 32,000 Unicode characters long. However, each component in the path cannot be more than a file-system-specific value indicated by the function GetVolumeInformation. You must use full paths with this technique. This technique also works with universal naming convention (UNC) names such as "\\OtherComputer\Directory\Filename.ext".

The \\?\ is ignored as part of the path example, and "\\?\C:\myworld\private" is seen as "C:\myworld\private".