summaryrefslogtreecommitdiffstats
path: root/apps/aux/system.scm
diff options
context:
space:
mode:
authorAndreas Widen <andreas@harmonicflow.org>2023-11-25 17:21:37 +0100
committerAndreas Widen <andreas@harmonicflow.org>2023-11-25 17:21:37 +0100
commit1b2b7c3eb939724696894f31ff27db97b0cac84c (patch)
treeefb7b7746a628efb7bb99b2e44c9c2fbfd75b656 /apps/aux/system.scm
downloadhf-web-1b2b7c3eb939724696894f31ff27db97b0cac84c.tar.xz
hf-web-1b2b7c3eb939724696894f31ff27db97b0cac84c.zip
Initial commit.
Signed-off-by: Andreas Widen <andreas@harmonicflow.org>
Diffstat (limited to 'apps/aux/system.scm')
-rw-r--r--apps/aux/system.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/aux/system.scm b/apps/aux/system.scm
new file mode 100644
index 0000000..ee9a5a3
--- /dev/null
+++ b/apps/aux/system.scm
@@ -0,0 +1,32 @@
+;;; Harmonic Flow web site
+
+(define-module (apps aux system)
+ #:export (path-join))
+
+
+;;;
+;;; Procedures.
+;;;
+
+(define (path-join . parts)
+ "Return a system path composed of the given PARTS.
+
+ PARTS (strings)
+ A succession of strings representing parts of a file system path.
+
+ To indicate an absolute path, use an empty string as the first
+ part. For example:
+
+ (path-join '' 'docs' 'manual')
+ => '/docs/manual'
+
+ To end the path with a slash, use an empty string as the last
+ part. For example:
+
+ (path-join '' 'docs' 'manual' '')
+ => '/docs/manual/'
+
+ RETURN VALUE (string)
+ A string representing a file system path."
+ (cond ((equal? parts '("")) "/") ; Root directory
+ (else (string-join parts file-name-separator-string))))