summaryrefslogtreecommitdiff
path: root/website/apps/aux/system.scm
blob: b44111e7bc9fb1a526206f8c4c1af7c42184e8d7 (about) (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
33
34
;;; GNU Guix web site
;;; Initially written by sirgazil who waves all
;;; copyright interest on this file.

(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))))