summaryrefslogtreecommitdiff
path: root/tex/context/base/luat-run.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-11-09 21:40:13 +0200
committerMarius <mariausol@gmail.com>2013-11-09 21:40:13 +0200
commitb061ca19f9a8721105957f51448400425adaf7e8 (patch)
tree30f629679b112339410a2b17a4bbc33ddcb7d408 /tex/context/base/luat-run.lua
parentef273426ef4cecf5804a6fc9cf0e627f2edec7fd (diff)
downloadcontext-b061ca19f9a8721105957f51448400425adaf7e8.tar.gz
beta 2013.11.09 20:21
Diffstat (limited to 'tex/context/base/luat-run.lua')
-rw-r--r--tex/context/base/luat-run.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/tex/context/base/luat-run.lua b/tex/context/base/luat-run.lua
index eaede1030..719a6f7c9 100644
--- a/tex/context/base/luat-run.lua
+++ b/tex/context/base/luat-run.lua
@@ -103,23 +103,25 @@ callbacks.register("pre_dump", pre_dump_actions, "lua related fi
local tempfiles = { }
-function luatex.registertempfile(name,extrasuffix)
+function luatex.registertempfile(name,extrasuffix,keep) -- namespace might change
if extrasuffix then
name = name .. ".mkiv-tmp" -- maybe just .tmp
end
if trace_temp_files and not tempfiles[name] then
report_tempfiles("registering temporary file %a",name)
end
- tempfiles[name] = true
+ tempfiles[name] = keep or false
return name
end
function luatex.cleanuptempfiles()
- for name, _ in next, tempfiles do
- if trace_temp_files then
- report_tempfiles("removing temporary file %a",name)
+ for name, keep in next, tempfiles do
+ if not keep then
+ if trace_temp_files then
+ report_tempfiles("removing temporary file %a",name)
+ end
+ os.remove(name)
end
- os.remove(name)
end
tempfiles = { }
end