| aj3423 (65) | |||
|
Hi, I want to overwrite some bytes of a file, for example
I just need to replace the first 3 bytes, but the file was totally truncated. the other bytes were gone. is there any simple way to do this? I don't want to read the hole file into buffer then get the replacement done and write back, because the file could be very large. | |||
|
|
|||
| kbw (5374) | |
|
Have a look at the flags. I expect you'll need to use an append flag. http://www.cplusplus.com/reference/fstream/fstream/open/ | |
|
|
|