;;AUTOLOAD: recursive-mkdir
;;AUTODOC: recursive-mkdir
;;(recursive-mkdir dir)
;;
;;Creates the directory and all the directories necessary in the hierachy


(defvar recursive-mkdir:re-parent (regcomp "^(.+)[/]([^/]+)[/]?$"))

(defun recursive-mkdir (dir)
  (if (/= 'directory (file-type dir)) (progn
      (if (regexec recursive-mkdir:re-parent dir)
	(recursive-mkdir (regsub recursive-mkdir:re-parent 1))
      ) (progn
	(wait (system (list "mkdir" dir)))
	(wait (system '("sync")))
))))
