From 1b2b7c3eb939724696894f31ff27db97b0cac84c Mon Sep 17 00:00:00 2001 From: Andreas Widen Date: Sat, 25 Nov 2023 17:21:37 +0100 Subject: Initial commit. Signed-off-by: Andreas Widen --- apps/aux/system.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 apps/aux/system.scm (limited to 'apps/aux/system.scm') 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)))) -- cgit v1.2.3-54-g00ecf