I guess that is his original fault. It is legit AFAIK but initializes str with the same string "constant" every time. Now as we all know there is no such thing as real constants in LiteC so every time this function is called the same content is added over and over again. That is most likely the reason why he thinks the data is appended to the file while in fact he just appends to the string every time he calls this function and that causes the same stuff to appear multiple times in the file.

str_create is necessary when you want to have a fresh string every time you call that function.


Always learn from history, to be sure you make the same mistakes again...