summaryrefslogtreecommitdiffstats
path: root/apps/aux/system.scm
diff options
context:
space:
mode:
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))))