Skip to content

Support path prefix which refers to per-user DosDevices ("\??\C:\...") #56030

@kgv

Description

@kgv

std::path::Prefix does not support windows prefixes like \??\C:\....

See more about prefix which refers to per-user DosDevices

#![allow(unused)]
use std::path::{Component, Path, Prefix};
fn main() {
    let path = Path::new(r"\??\C:\Users\Rust\Pictures\Ferris");
    assert!(path.is_absolute());
}

(Playground)

Errors:

   Compiling playground v0.0.1 (/playground)
    Finished dev [unoptimized + debuginfo] target(s) in 0.61s
     Running `target/debug/playground`
thread 'main' panicked at 'assertion failed: path.is_absolute()', src/main.rs:7:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`O-windowsOperating system: WindowsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions