τau /

path

module
path = import("path")

path - slash separated paths.

Paths are strings and the separator is "/", the way it is on every system tau runs on. Nothing here touches the filesystem: these are string operations, and a path that doesn't exist is handled just the same.

Separator = "/"valuesource

IsAbs = fn(p)source

IsAbs reports whether p starts at the root.

Base = fn(p)source

Base returns the last element of p. An empty path gives ".", a path made of separators gives "/".

Dir = fn(p)source

Dir returns everything but the last element of p, cleaned. A path without separators gives ".".

Ext = fn(p)source

Ext returns the extension of p, the final dot included, or an empty string when the last element has none.

Split = fn(p)source

Split returns the directory and the file part of p, joined back by "+".

Clean = fn(p)source

Clean returns the shortest path with the same meaning: no "." elements, no double separators, and ".." resolved against what comes before it.

Join = fn(elems)source

Join joins the non empty elements with the separator and cleans the result.