summaryrefslogtreecommitdiffstats
path: root/apps/aux/system.scm
blob: ee9a5a3927f319cb0eb4bec460302dd388fe44d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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))))