Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion: Preallocated file open
#11
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 `PREALLOCATE` command which takes a file number, rather than another setting on `OPEN` itself. 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).
Reply


Messages In This Thread
Suggestion: Preallocated file open - by doppler - 01-09-2023, 01:01 AM
RE: Suggestion: Preallocated file open - by DSMan195276 - 01-09-2023, 07:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Download the file from the internet and extract the .zip file quickbasic 6 668 10-25-2025, 01:39 AM
Last Post: madscijr
  Cautionary tale of open, append, close doppler 3 865 01-16-2025, 10:23 AM
Last Post: doppler
  Mix mode input of a binary open file Question! doppler 5 1,482 11-28-2024, 03:06 PM
Last Post: Petr
  qb64 "OPEN" linux /dev/ devices Parkland 2 791 06-30-2024, 02:52 AM
Last Post: DSMan195276
  suggestion: create a custom puppy linux distro that includes QB64PE out of the box madscijr 13 2,808 02-07-2024, 02:25 PM
Last Post: TerryRitchie

Forum Jump:


Users browsing this thread: 1 Guest(s)