game.write_file not appending
Posted: Fri Jan 28, 2022 6:20 pm
https://lua-api.factorio.com/latest/Lua ... write_file
So I have this piece of code:
And I expect my txt file to grow with 1 line each time this is executed. But: it's not. Only the last line is in the file. Why is the append not working?
Code: Select all
write_file (filename, data, append, for_player)
Code: Select all
local function log_message(msg)
msg = game.tick .. " " .. msg
game.write_file(baseFolder .. baseFile, "[FactorioChatBot]: " .. serpent.line(msg, { comment = false }, true))
end