01-09-2023, 07:33 PM
FWIW such 'preallocate' functionality has benefits beyond just the potential to reduce fragmentation of the underlying file - it's generally an almost instant operation and can be used to ensure there is enough space on the disk to fit your file. If you're writing a 4GB file, it would be much nicer to be able to preallocate the 4GB of space before you do any work and get a quick failure if there is not enough vs. have it fail after you've spent a long time writing that data.
The only thing on my mind if we did add such a thing is that I think it would make more sense as a separate
The only thing on my mind if we did add such a thing is that I think it would make more sense as a separate
PREALLOCATEcommand which takes a file number, rather than another setting on
OPENitself. I'm not sure if that would work with how Windows makes you do it though, I'd have to check (on Linux that's fine since
fallocate()is a separate function anyway).