The text2file() function appends a newline at the end of the file it is spitting text into, even if the variable being dumped doesn't have a newline at the end. Calling the function multiple times on the same file will cause many newlines to be appended to the end of the file.
Numbered Steps to Reproduce Problem:
1) Use text2file("my_text","my_file.txt")
2) Open my_file.txt to see "my_text" with a newline after it, call the function more than once and notice multiple newlines.
Code Snippet (if applicable) to Reproduce Problem:
mob/verb/Test()
text2file("my_text","my_file.txt")
Expected Results:
Text to be written exactly as it appears in the variable.
Actual Results:
Newlines being appended to the end of the file.
Does the problem occur:
Every time? Or how often? Every time.
In other games? Yes.
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur?
Never.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
It has been happening as long as I can remember.
Workarounds:
[Edit]
Append \... to the end of the text you're spitting into the file.