From 2a8fb2ce5b5b543589244271008643bcb2f00268 Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Wed, 17 Jul 2024 17:25:29 +0100 Subject: [PATCH] Simplify call-with-temporary-directory. --- modules/ordo/util/filesystem.scm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/ordo/util/filesystem.scm b/modules/ordo/util/filesystem.scm index 65f6f28..5f3d14f 100644 --- a/modules/ordo/util/filesystem.scm +++ b/modules/ordo/util/filesystem.scm @@ -52,9 +52,7 @@ (define (call-with-temporary-directory proc) "Call PROC with a name of a temporary directory; close the directory and delete it when leaving the dynamic extent of this call." - (let* ((directory (or (getenv "TMPDIR") "/tmp")) - (template (string-append directory "/ordo.XXXXXX")) - (tmp-dir (mkdtemp! template))) + (let ((tmp-dir (create-temporary-directory))) (dynamic-wind (const #t) (lambda ()