 	[clojure.java.io :only (file)])
   (:import (java.io File)))
 
+;; You don't create instances of this; use the temp-file function.
 (deftype TempFileContext [name suffix dir ^{:tag File :unsynchronized-mutable true} f]
   Context
   (setup [this] (set! f (File/createTempFile name suffix dir)))

  If suffix is a file extension, it should include the leading period,
  e.g., \".txt\"

  If dir is specified (string or File), the temporary file will be
  created in that directory; otherwise it will be in the
  system-default temporary directory."
  ([]

	    (doseq [x (reverse (file-seq f))]
	      (.delete x))))

(defn temp-dir
  "Returns a stateful context that creates a temporary directory.
  After setup, an empty directory named with the given
  prefix (optional) will exist.  The state of the context is the
  java.io.File.  The directory and all its contents will be
  recursively deleted during teardown.

  If dir is specified (String or File), the temporary directory will
  be created in that directory; otherwise it will be in the
  system-default temporary directory."
  ([]
