14.1.2 More Path Utilities
Returns the list of path element that constitute
path. If
path is simplified in the sense of
simple-form-path,
then the result is always a list of paths, and the first element of
the list is a root.
Returns the last element of
path. If
path
syntactically a directory path (see
split-path), then then
result is
#f.
Returns a byte string that is the extension part of the filename in
path without the
. separator. If
path is
syntactically a directory (see
split-path) or if the path has
no extension,
#f is returned.
Finds a relative pathname with respect to
base that names the
same file or directory as
path. Both
base and
path must be simplified in the sense of
simple-form-path. If
path is not a proper subpath of
base (i.e., a
subpath that is strictly longer),
path is returned.
For most purposes, simple-form-path is the
preferred mechanism to normalize a path, because it works for paths
that include non-existent directory components, and it avoids
unnecessarily expanding soft links.
Returns a complete version of path by making the path
complete, expanding the complete path, and resolving all soft links
(which requires consulting the filesystem). If path is
relative, then wrt is used as the base path.
Letter case is not normalized by normalize-path. For
this and other reasons, such as whether the path is syntactically a
directory, the result of normalize-path is not suitable for
comparisons that determine whether two paths refer to the same file or
directory (i.e., the comparison may produce false negatives).
An error is signaled by normalize-path if the input
path contains an embedded path for a non-existent directory,
or if an infinite cycle of soft links is detected.
If path is a filename, the file’s path is returned. If
path is syntactically a directory, path is returned
(as a path, if it was a string). If path has no directory part
#f is returned.
Converts path to a string using a UTF-8 encoding of the
path’s bytes.
Use this function when working with paths for a different system
(whose encoding of pathnames might be unrelated to the current
locale’s encoding) and when starting and ending with strings.
Converts str to a kind path using a UTF-8 encoding
of the path’s bytes.
Use this function when working with paths for a different system
(whose encoding of pathnames might be unrelated to the current
locale’s encoding) and when starting and ending with strings.