diff options
author | Hans Hagen <pragma@wxs.nl> | 2013-11-09 20:21:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2013-11-09 20:21:00 +0100 |
commit | 148a3541e75ffe0d68c7c18175460328b22fd618 (patch) | |
tree | bf5f7e361e9f96500a55f4be04e4052c6dbcf737 /tex/context/base/luat-run.lua | |
parent | 952996cd380902fbb5a4266df7b7257d24d73652 (diff) | |
download | context-148a3541e75ffe0d68c7c18175460328b22fd618.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 |