From d88af17c09962b23defb543e60dbd85dc50c6f5f Mon Sep 17 00:00:00 2001 From: empathicqubit Date: Wed, 28 Apr 2021 23:29:43 -0400 Subject: [PATCH] Truncation --- runner-process.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runner-process.lua b/runner-process.lua index 1820bb7..f8c2d3b 100644 --- a/runner-process.lua +++ b/runner-process.lua @@ -144,8 +144,14 @@ local function waitLoop() }) ) + -- Truncate the input file to reduce the amount of time + -- wasted if we reopen it too early + local inputFile = io.open(inputFilePath, "w") + inputFile:close() + waiter = util.waitForChange(inputFilePath) + -- Write the result local outFile = io.open(outputFilePath, "w") outFile:write(table.concat(outContents, "\n")) outFile:close()