How to write to the end of the file?
file:write() just replaces the text.
According to the documentation , you need to open the file in add-on mode.
An example from there:
-- Opens a file in append mode file = io.open("test.lua", "a") -- appends a word test to the last line of the file file:write("--test") -- closes the open file file:close() Source: https://ru.stackoverflow.com/questions/597414/
All Articles