Skip to main content

path_to_absolute_string

Function path_to_absolute_string 

Source
pub fn path_to_absolute_string(path: &Path) -> String
Expand description

Converts a path to an absolute path string, stripping Windows UNC prefix if present.

This function canonicalizes the path and removes the Windows \\?\ prefix if it exists. If canonicalization fails (e.g., path doesn’t exist), it returns the path as-is.

§Arguments

  • path - The path to convert

§Returns

Returns the absolute path as a string, with Windows UNC prefix removed.