anchor.diff:                         :defaults defaults
                          :max-tries max-tries)))
   
  -(defmacro with-open-temporary-file ((stream &rest args) &body body)
  +(defmacro with-open-temporary-file ((stream &rest args &key (keep t)) &body body)
     "Create a temporary file using OPEN-TEMPORARY with ARGS and run BODY
     with STREAM bound to the temporary file stream.  See OPEN-TEMPORARY
  -  for permitted options."
  +  for permitted options.  If KEEP is set to NIL, the file is deleted
  +  when the body is exited."
     `(with-open-stream (,stream (open-temporary ,@args))
  -     ,@body))
  +     (unwind-protect
  +          (progn ,@body)
  +       (unless ,keep
  +         (when (probe-file (pathname ,stream))
  +           (delete-file (pathname ,stream)))))))
  
positive.code: 
  (in-package :temporary-file)
  
  (defparameter *default-temporary-directory*
    #-windows (load-time-value (or (directory-from-environment "TMPDIR")
                                   #P"/tmp/"))
    #+windows (load-time-value (or (directory-from-environment "TEMP")
                                   (error 'missing-temp-environment-variable))))
  
  (eval-when (:load-toplevel :execute)
    (when (and (null (logical-pathname-translations "TEMPORARY-FILES"))
               (probe-file *default-temporary-directory*))
      (setf (logical-pathname-translations "TEMPORARY-FILES") `(("*.*.*" ,*default-temporary-directory*)))))
  
  (define-condition missing-temp-environment-variable (error)
    ()
  
negative.code: 
  ;; locking for multi-threaded operation with unsafe random function
  
  (defvar *create-file-name-lock* (bordeaux-threads:make-lock "Temporary File Name Creation Lock"))
  
  (defmacro with-file-name-lock-held (() &body body)
    `(bordeaux-threads:with-lock-held (*create-file-name-lock*)
       ,@body))
  
  (defun generate-random-string ()
    (with-file-name-lock-held ()
  