How to create a sparse file on NTFS?

前端 未结 2 1414
独厮守ぢ
独厮守ぢ 2021-01-04 07:13

I\'m testing a sparse file. But my test code doesn\'t work well.

HANDLE h = CreateFileW(L\"D:\\\\sparse.test\",
        GENERIC_READ|GENERIC_WRITE,
        F         


        
2条回答
  •  天命终不由人
    2021-01-04 08:04

    You have to create a normal file, then use DeviceIoControl with FSCTL_SET_SPARSE to make it a sparse file.

提交回复
热议问题