diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index b2be9d707..f34c5222d 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -1040,6 +1040,21 @@ If @var{suffix} is provided, and is equal to the end of @end lisp @end deffn +@deffn {Scheme Procedure} canonicalize-path path +@deffnx {C Function} scm_canonicalize_path (path) +Return the canonical (absolute) path of @var{path}. +A canonical path has no @code{.} or @code{..} components, +nor any repeated path separators (@code{/}) nor symlinks. + +Raises an error if any component of @var{path} does not +exist. + +@lisp +(canonicalize-path "test.xml") +@result{} "/tmp/test.xml" +@end lisp +@end deffn + @deffn {Scheme Procedure} file-exists? filename Return @code{#t} if the file named @var{filename} exists, @code{#f} if not.