Skip to content

Commit

Permalink
Make ensure-dir platform-neutral.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Feb 29, 2008
1 parent dd92f41 commit 111fa3c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions arc.arc
Expand Up @@ -1212,9 +1212,22 @@
(or (errsafe (load-table filename))
(table)))

(def mkdir (path (o parents))
((if parents
(let os (which-os)
(if
; If we're running Unix, MzScheme <371 has a bug
; where make-directory* sets the sticky bit.
; Thus, we want to use system instead.
(or (is os 'unix) (is os 'macosx))
[system (string "mkdir -p " _)]
($ (begin (require (lib "file.ss")) make-directory*))))
($ make-directory))
path)
nil)

(def ensure-dir (path)
(unless (dir-exists path)
(system (string "mkdir -p " path))))
(mkdir path t))

(def pad (val digits (o char #\ ))
(= val (string val))
Expand Down

0 comments on commit 111fa3c

Please sign in to comment.