Following this question: How to quickly create large files in C?
I remember 4-5 years ago, I was able to use fallocate
shell utility in Linux to create files without holes/gaps.
Disk filesystem was either ext3, ext4 or xfs.
At that time, fallocate
shell utility created files of 8 GB in less one second. I do not remember if file was full of zeroes or random.
I try to replicate this nowadays, but it seems to create file with holes/gaps.
I am wondering how this was done in C
language?
- Some kernel call that is Linux only?
- Some kernel call with error in specification that was later fixed?
- Some kernel call that is no longer available?