std/pathnorm (original) (raw)
OS-Path normalization. Used by os.nim but also generally useful for dealing with paths.
Unstable API.
Procs
proc addNormalizePath(x: string; result: var string; state: var int; dirSep = DirSep) {....raises: [], tags: [], forbids: [].}
Low level proc. Undocumented.Source Edit
proc normalizePath(path: string; dirSep = DirSep): string {....raises: [], tags: [], forbids: [].}
Example:
when defined(posix): doAssert normalizePath("./foo//bar/../baz") == "foo/baz"