diff options
author | Marius <mariausol@gmail.com> | 2013-11-09 21:40:13 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-11-09 21:40:13 +0200 |
commit | b061ca19f9a8721105957f51448400425adaf7e8 (patch) | |
tree | 30f629679b112339410a2b17a4bbc33ddcb7d408 /tex/context/base/luat-run.lua | |
parent | ef273426ef4cecf5804a6fc9cf0e627f2edec7fd (diff) | |
download | context-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.lua | 14 |
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 |