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

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)
#+end_src

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

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