aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/guile/util-path.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ref/guile/util-path.texi')
-rw-r--r--doc/ref/guile/util-path.texi17
1 files changed, 17 insertions, 0 deletions
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