Pudu programming language
Menu
API reference

Std.Path.normalize

1 declaration

fn

normalize: Str -> Str

This is a callable function.

What it does

A path with . removed and each .. applied to the piece before it.

This is done by reading the path rather than by asking the file system, so

it does not follow links and does not need the path to exist. Where a link

is involved the two answers differ, and the one that does not touch the

disk is the one a program can rely on before creating anything.

A .. that would climb past the root stays at the root, because there is

nothing above it; a .. at the front of a relative path is kept, because

what it climbs to is not known until the path is resolved against

somewhere.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.

Back to Std.PathSearch related declarations