Skip to main content

Module windows_path

Module windows_path 

Source
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 own std::fs calls.

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, or None when 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.