See the code posted with this answer [
^].
Quote:
The documentation is correct – but note that open and append are not synonymous. FileMode.OpenOrCreate is not overwriting the file, but the stream does start at the beginning of the file if one already exists. What you are observing is the contents being overwritten by the StreamWriter, not the FileStream constructor overwriting the file.
You have to move the stream position to the end of the file to add text at the end. To do this, you could move the position with FileStream.Seek() or change the FileMode to FileMode.Append. However, using FileMode.Append also requires making the stream write-only, rather than read-write.
.If you intend to always delete the existing file:
if (File.Exists(savefile))
{
File.Delete(savefile);
}