Now that I've had time to get over my embarrassment, I'm still a bit curious as to how do this if I were
into the file rather than overwriting. If the file is very large, what would be the best/fastest/memory efficient way to copy big sections (including up to the end of the file) of an input file to an output file? A character at a time sounds inefficient, so I'm assuming larger chunks would be better, but then you need to handle the end of the file carefully etc.