How to create a file with file holes?

后端 未结 4 1840
故里飘歌
故里飘歌 2020-12-02 14:58

File holes are the empty spaces in file, which, however, doesn\'t take up any disk space and contains null bytes. Therefore, the file size is larger than its actual size on

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 15:12

    Aside from creating files with holes, since ~2 months ago (mid-January 2011), you can punch holes on existing files on Linux, using fallocate(2) FALLOC_FL_PUNCH_HOLE LWN article, git commit on Linus' tree, patch to Linux's manpages.

提交回复
热议问题