Exactly. Right now, let's say you have this:
"this is
the contents of
my file
that i am
writing."
The first iteration of your while loop writes this:
"this is"
The second loop, due to your concatenation, writes this:
"this is the contents of"
And the third:
"this is the contents of my file"
So right now, your destination file reads like so:
"this isthis is the contents ofthis is the contents of my file"
😛