Search code examples
cfilemmap

is write to the middle of mapped adress will grow the file? just like fseek does?


sample illustration

if I write data to the middle of the allocated address space, will the file size increase. just like fseek does ?

or it will write to the beginning of the file ?


Solution

  • The answer is no. writeto mmap will not grow the file or create sparse file. I have to allocate the file manually.