I'm logging to a file using FileStream.Write(). When the file reaches a maximum size, I want to delete a load of the logs from the start of the file. What's the best way of doing this?
The best idea I've got so far is to create a second file. Write everything I want to keep from the original file into it. Then delete the original file, and rename the second file with the original files name.
Is there a more simple and efficient way I can do this?