Expand description
Windows extended-length (\\?\ verbatim) path semantics, owned in one
place so the \\?\ / \\?\UNC\ prefix rules live at a single source of
truth.
Two paired directions:
strip_windows_verbatim_prefixremoves the prefix so a canonicalized path parses under normal Windows rules (and can re-enter/-joining code, or prefix-match a plainC:\mount point). It is pure string logic and cross-platform: a well-formed absolute path off Windows never carries the prefix, so callers on any platform may normalize a Windows-shaped string through it.- [
wide_maybe_verbatim] adds the prefix to aMoveFileExWoperand so a durable write survives a path longer than the legacy 260-charMAX_PATH. It mirrors the standard library’s conservativemaybe_verbatimrules and is Windows-only.
Functions§
- strip_
windows_ verbatim_ prefix - Strip a Windows verbatim (
\\?\) prefix from a path string:\\?\UNC\server\share->\\server\share,\\?\C:\dir->C:\dir. Inputs without the prefix — every well-formed Unix path, plain Windows paths, and\\.\device paths — are returned unchanged.