make-directory will create a directory, but the parent of that directory must already exist. If you want to be able to create a directory and not worry about whether the parent directory exists, you need to write a little code:
(define (make-directoriespath)
(letrec ((normpath (simplify-pathpath))
; assumes that path does not exist. Caller should
; verify that before calling.
(make-directory-rec
(lambda (normpath)
(let-values (((parentleafign) (split-pathnormpath)))
(when (not (directory-exists?parent))
(make-directory-recparent))
(make-directorynormpath)))))
(if (or (directory-exists?normpath)
(file-exists?normpath))
(error"Cannot make directory:"path"already exists.")
(make-directory-recnormpath))))
make-directory-rec is where all the real work is, the rest of this is error checking. make-directory-rec splits the path given into a parent and leaf node. If the parent doesn't exist, make-directory-rec calls itself recursively. Then it creates the leaf directory.