Expand description
Windows extended-length path normalization.
std::fs::canonicalize returns paths in the extended-length namespace on
Windows. Only DOS-drive and UNC names have a safe non-verbatim spelling;
other namespaces (for example \\?\Volume{GUID}\) must retain their prefix.
Constants§
- PLAIN_
WIN32_ PATH_ LIMIT - Plain (non-
\\?\) paths at least this many UTF-16 units long are passed to raw Win32 calls in extended-length form. Directory APIs refuse plain names from 248 units on and file APIs from 260 (MAX_PATH); the Rust standard library already does this for its ownstd::fscalls.
Functions§
- extended_
length_ path_ text - The extended-length (
\\?\) spelling of an absolute DOS-drive or UNC path, for the argument of a raw Win32 call, orNonewhen the plain form is short enough, already names a device namespace, or cannot be spelled literally (a relative path, or one with.or..components, which Windows would not resolve after the prefix). - non_
verbatim_ path_ text - String form of the strict verbatim-prefix conversion, for APIs that require a command line
or URI rather than a
Path. - normalize_
windows_ path - Normalize a Windows path for comparisons and Win32 APIs.