progs/bf/bfc1.sc
changeset 991 5d01eccc2036
parent 825 dca072e2bb7d
--- a/progs/bf/bfc1.sc	Fri Sep 26 19:09:50 2025 +0100
+++ b/progs/bf/bfc1.sc	Fri Sep 26 23:10:52 2025 +0100
@@ -59,10 +59,11 @@
 // BF program and running the resulting binary
 
 def compile_and_run(prog: String) = {
-  val tn = "tmp"
+  val hash = java.util.UUID.randomUUID().toString.take(4)
+  val tn = s"tmp_$hash"
   compile_to_file(s"${tn}.c", prog)
   os.proc("gcc", "-O0", "-o", tn, s"${tn}.c").call() // call gcc
-  os.proc("./tmp").call(stdout = os.Inherit)         // run binary
+  os.proc(os.pwd / s"${tn}").call(stdout = os.Inherit)         // run binary
 }
 
 // Running Testcases