I am unsure why I am not passing the verification, because when I write:
B:\Documentos\temp.txt
Line1
Line2
Line3
exit
I end up having the file as requested, I also tried changing line 32 by
content = content + newline;
with identical results.