diff options
author | Norbert Preining <norbert@preining.info> | 2022-10-05 03:01:34 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-10-05 03:01:34 +0000 |
commit | 6925a15396a955498e1d1663204e7fa7da3d1728 (patch) | |
tree | 925ce3e30472ef82315230ec2772e2e104642541 /macros/luatex/generic/lualibs/lualibs-io.lua | |
parent | 30b3429f0e138c93c5f1ba1d1a6d46728c0943e9 (diff) |
CTAN sync 202210050301
Diffstat (limited to 'macros/luatex/generic/lualibs/lualibs-io.lua')
-rw-r--r-- | macros/luatex/generic/lualibs/lualibs-io.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/macros/luatex/generic/lualibs/lualibs-io.lua b/macros/luatex/generic/lualibs/lualibs-io.lua index a955262a31..6bf7a97bda 100644 --- a/macros/luatex/generic/lualibs/lualibs-io.lua +++ b/macros/luatex/generic/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) |