1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 29 October 2012 - 10:43 PM
1604 posts
Posted 29 October 2012 - 10:51 PM
Open the file in append mode:
local file = fs.open("path/to/file", "a")
if file then
file.writeLine("some random text")
file.close()
end
That way it will write to the end of the file, without deleting the previous contents.
1029 posts
Location
Missouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension
Posted 29 October 2012 - 11:02 PM
Will it add a line?
Ex.
It writes "1"
then later writes "2"
will the file it writes look like
1
2
or will it look like
12
?
1604 posts
Posted 29 October 2012 - 11:40 PM
If you use writeLine it will be in a new line, if you use write it will be in the same line.