Memory mapped QFile usage questions
I have a pretty large file (hundreds megabytes). I have a list of thousands (possibly even hundreds thousand) locations in this file where I need to patch 4 bytes. Specific algorithm:
seekto a position;
- overwrite 4 bytes;
- run and external tool on this file;
- revert these 4 bytes to the original value and proceed to the next location.
- Is it faster to map the whole file once, or
- Do I need to take special actions for the change to be actually written on disk? Will
flushsuffice, or do I have to
Turns out speed is not a concern, I started by trying
flush- it's fast,
I've also noticed that I don't need to call
flushin order for the changes to be visible to other software. Is that just a coincidence, or is it guaranteed to work (this is a Windows only program)?