tuned signature;
authorwenzelm
Fri, 16 Sep 2022 20:54:56 +0200
changeset 76177 b847a9983784
parent 76176 d6bd84eb94a3
child 76178 1f95e9424341
tuned signature;
src/Pure/System/isabelle_system.scala
--- a/src/Pure/System/isabelle_system.scala	Fri Sep 16 16:34:45 2022 +0200
+++ b/src/Pure/System/isabelle_system.scala	Fri Sep 16 20:54:56 2022 +0200
@@ -282,8 +282,12 @@
     file
   }
 
-  def with_tmp_file[A](name: String, ext: String = "")(body: Path => A): A = {
-    val file = tmp_file(name, ext)
+  def with_tmp_file[A](
+    name: String,
+    ext: String = "",
+    base_dir: JFile = isabelle_tmp_prefix()
+  )(body: Path => A): A = {
+    val file = tmp_file(name, ext, base_dir = base_dir)
     try { body(File.path(file)) } finally { file.delete }
   }
 
@@ -327,8 +331,11 @@
     dir
   }
 
-  def with_tmp_dir[A](name: String)(body: Path => A): A = {
-    val dir = tmp_dir(name)
+  def with_tmp_dir[A](
+    name: String,
+    base_dir: JFile = isabelle_tmp_prefix()
+  )(body: Path => A): A = {
+    val dir = tmp_dir(name, base_dir = base_dir)
     try { body(File.path(dir)) } finally { rm_tree(dir) }
   }