Path
Functions for constructing, inspecting, and manipulating paths.
path::base
1-parameter signature
path::base(path)
base returns the last component of the path or the path itself if it does not contain any directory separators.
- Parameters
pathStringThe path.
- Returns
StringThe last component of the path.
path::clean
1-parameter signature
path::clean(path)
clean returns the shortest path name equivalent to path.
- Parameters
pathStringThe path.
- Returns
StringThe shortest path name equivalent to path
path::dir
1-parameter signature
path::dir(path)
dir returns the directory component of path.
- Parameters
pathStringThe path.
- Returns
StringThe directory component of path.
path::ext
1-parameter signature
path::ext(path)
ext returns the extension of the last component of path.
- Parameters
pathStringThe path.
- Returns
StringThe extension of the last component of path.
path::is_abs
1-parameter signature
path::is_abs(path)
is_abs reports whether the path is absolute.
- Parameters
pathStringThe path.
- Returns
BooleanTrue if the path is absolute.
path::join
Variadic signature
path::join(elements...)
join joins any number of path elements into a single path, separating them with slashes.
- Parameters
elementsString, repeated | String[]The path elements
- Signature
- Variadic
- Returns
StringSingle path from the given elements.
path::match
2-parameter signature
path::match(pattern, name)
match reports whether name matches the pattern.
- Parameters
patternStringThe pattern.nameStringThe name.
- Returns
BooleanTrue if the name matches the pattern.
path::separate
1-parameter signature
path::separate(path)
separate separates the path into a directory and filename component.
- Parameters
pathStringThe path
- Returns
Any[]First item is a directory component, and second is a filename component.