Another appraoch would be to use the FileStream.SetLength to the length you desire. There is no such thing as an EOF marker in Windows, there it simply the size of the file. FileMode.Create will overwrite the old file with the new one, SetLength will drop the size to the desired size.
|