I am working on an encryption system, which in theory should support incredibly huge files (50GB and more). Encryption algorthm is a bit complex and it requires writing to an output file in a non-contiguous way, meaning all file space has to be accessible before writing any data to it.
Working with memory is out of option, since most people are not gonna have enough memory. I would need to write straight to a file, hence reserve disk space instead.
I am aware of std::filesystem::resize_file
, but honestly I am not sure how it works. Does it actually reserve disk space or does it reserve memory? If it reserves disk space, is it capable of non-contiguous reservation? Because disk space is usually very fragmented and contiguous reservation of (let’s say) 50GB most likely not gonna be allowed even when disk has way more free space.