keen/io/path

Source
parent-path string(a string)

Functions for operating on paths. There is technically no I/O here; for functions like reading from a path, see keen/io/file.

Parent of a path. This means removing the last path component. "" if the path has no parent.

child-path string(a string, child_name string)
Adds a new path component onto the end.
get-extension string option(name string)
Gets the extension from a file name or path. Returns an empty option if there is no extension.
remove-extension string(name string)

Removes the extension from a file name or path. This returns the path without the extension.

For example: "birds/keen.txt" remove-extension is "birds/keen".

add-extension string(name string, ext string)
Adds an extension to a file name or path. If an extension already exists, adds a second one, as in foo.png.txt.
change-extension string(name string, ext string)
Removes the extension (if it exists) and adds a new one.
base-name string(path string)
Gets just the file name without any directory names in from of it.