as wiki says for fileWrite: "Writes one or more strings to a the given file, starting at the current read/write position." I suppose when you open the file the position is set at the start of the file, so you'll have to read the it, and fileSetPos to add a line instead of rewriting it