A general, non-filesystem-specific pathname library.
Returns just the basename ofpath
, with any directory
removed. If path
does not contain a directory separator,
return the whole path
. If path
ends in a directory
separator (i.e. path is a directory), or is empty, return the
empty string.Returns just the directory of path
.
If path
is relative (or empty), return "."
.Returns the rightmost extension of path
, not including the
"."
. If there is no extension, returns #f
. The
extension will always be non-empty and contain no "."
s.Returns path
with the extension, if any, removed,
along with the "."
.Returns path
with the extension, if any, replaced
with ext
.Returns path
with any leading ../ removed.Returns #t
iff path
is an absolute path,
i.e. begins with "/".Returns #t
iff path
is a relative path.Returns the suffix of path
relative to the directory
dir
, or #f
if path
is not contained in
dir
. If the two are the same (modulo a trailing
"/"
), then "."
is returned.Resolve path
relative to the given directory. Returns
path
unchanged if already absolute.Returns a normalized version of path, with duplicate directory
separators removed and "/./" and "x/../" references removed.
Does not take symbolic links into account - this is meant to
be abstract and applicable to paths on remote systems and in
URIs. Returns path
itself if path
is already
normalized.Return a new string representing the path where each of args
is a path component, separated with the directory separator.
args
may include symbols and integers, in addition to
strings.