Skip to main content

preflight_volume_path_length

Function preflight_volume_path_length 

Source
pub fn preflight_volume_path_length(volume_root: &Path) -> Result<(), Error>
Expand description

Check volume root path length against the plan’s thresholds.

Returns Ok(()) below PATH_LENGTH_WARN, Ok(()) with a stderr warning when the length is at or above PATH_LENGTH_WARN but below PATH_LENGTH_ERROR, and Err(PathTooLong) when the length is at or above PATH_LENGTH_ERROR. The thresholds are inclusive at the boundary: the 120-char case fails; the 80-char case warns.

Length is measured in bytes of the OsStr representation. On ASCII paths (the overwhelming majority of volume roots) this equals the character count. On non-ASCII paths the threshold is conservative relative to Unicode length, which is the right direction for a headroom check against Windows MAX_PATH.