From 23cf6047ae320a1d666ddf6418bade67dfa95ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 2 Aug 2022 02:55:18 +0200 Subject: Add procedure relative-to. --- doc/ref/guile/util-path.texi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'doc') diff --git a/doc/ref/guile/util-path.texi b/doc/ref/guile/util-path.texi index 2a53ba91..cf99a170 100644 --- a/doc/ref/guile/util-path.texi +++ b/doc/ref/guile/util-path.texi @@ -43,3 +43,20 @@ Returns the extension of the filename, or the empty string if none exists. Equivalent of realpath(3). Absolute file names are returned as is, while relative filenames gets expanded to absolute filenames. @end defun + +@defun relative-to base path +Returns @var{path} as a relative path relative to @var{base}. + +base must be non-empty +@example +(relative-to "/some" "/some/path") +;; ⇒ "path" + +(relative-to "/some" "/other/path/") +;; ⇒ "../path" + +(relative-to "/a/b/c" "/a/b") +;; ⇒ "/a/b" +@end example + +@end defun -- cgit v1.2.3