diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-io.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/lualibs/lualibs-io.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-io.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-io.lua index a955262a31e..6bf7a97bda2 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-io.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-io.lua @@ -147,9 +147,12 @@ function io.copydata(source,target,action) end end -function io.savedata(filename,data,joiner) - local f = open(filename,"wb") +function io.savedata(filename,data,joiner,append) + local f = open(filename,append and "ab" or "wb") if f then + if append and joiner and f:seek("end") > 0 then + f:write(joiner) + end if type(data) == "table" then f:write(concat(data,joiner or "")) elseif type(data) == "function" then @@ -288,7 +291,8 @@ end io.noflines = noflines --- inlined is faster ... beware, better use util-fil +-- inlined is faster ... beware, better use util-fil so these are obsolete +-- and will go local nextchar = { [ 4] = function(f) |