** creating a directory when needed for tangling
   :DATE:     2011-01-19
#+begin_src clojure :tangle (prog1 "src/foo.clj" (make-directory "src" "."))
  (ns something)

a helper function for the above
#+begin_src emacs-lisp
  (defun mkdir-p (file &optional dir)
    "Create any parent directories of FILE if missing and return FILE."
    (make-directory (file-name-directory file) (or dir ".")) file)

allows the following
#+begin_src clojure :tangle (mkdir-p "src/foo.clj")
  (ns something)

There is now a new header argument controlling this behavior
#+begin_src emacs-lisp :mkdirp yes :tangle novel/nested/directories/finally.clj
  (message "contents")