[Git][cmucl/cmucl][issue-373-handle-temp-files] Make with-temporary-directory actuall work.

Raymond Toy pushed to branch issue-373-handle-temp-files at cmucl / cmucl Commits: 0eb4531e by Raymond Toy at 2025-02-14T12:41:40-08:00 Make with-temporary-directory actuall work. Minor fixups to make with-temporary-directory actually work. - - - - - 1 changed file: - src/code/extensions.lisp Changes: ===================================== src/code/extensions.lisp ===================================== @@ -665,18 +665,20 @@ is used as a prefix for the name of the temporary directory. The directory and all its contents are automatically removed afterward." (let ((err (gensym "ERR-"))) - `(let (,err) + `(let (,dirname ,err) (unwind-protect - (multiple-value-setq (,dirname ,err) - (unix::unix-mkdtemp (concatenate 'string ,template - "XXXXXX"))) - (unless ,dirname - (error "Unable to create temp directory: ~A" - (unix:get-unix-error-msg ,err))) - (locally ,@decls - ,@forms)) - ;; Remove the temp directory and all its contents. Is there a - ;; better way? - (ext:run-program "/bin/rm" (list "-rf" ,dirname))))) + (progn + (multiple-value-setq (,dirname ,err) + (unix::unix-mkdtemp (concatenate 'string ,template + "XXXXXX"))) + (unless ,dirname + (error "Unable to create temp directory: ~A" + (unix:get-unix-error-msg ,err))) + (locally ,@decls + ,@forms)) + ;; Remove the temp directory and all its contents. Is there a + ;; better way? + (when ,dirname + (ext:run-program "/bin/rm" (list "-rf" ,dirname))))))) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/0eb4531ed2f4396b2651f86b... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/0eb4531ed2f4396b2651f86b... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)