File_Utilities module

reduce_path

procedure · 1 overloadSource

A copy of path with the . words removed and each .. cancelled against the word before it.

reduce_path :: (path: Path) -> Path

A .. with nothing to cancel is kept in a relative path (../a), and dropped in a rooted one, where it would go above the root. Symbolic links are not looked at, so a/link/.. becomes a even if link points elsewhere. The result has a new words array (free it with array_free) whose words are the input's slices; the input is not changed.

Parameters

path: Path

Returns

See also