In spite of all the documentation I've read, this section of code will not do what I want:
ofstream outputFileStream;
outputFileStream.open(outputFileName, ios::binary|ios::out|ios::ate);
outputFileStream.close();
The file at outputFileName exists and has contents already. What this is SUPPOSED to do is open the file for writing anywhere I want (I should be able to use .seekp() to find my way around and modify bytes here and there). Once this is working, I will put my file modifications in between the .open and .close statements.
Instead, what actually happens is that it nukes outputFileName and creates a brand new empty file.
Does anybody have any idea what I'm doing wrong? :(
|