Windows has pretty shabby support for fallocate; by that I am saying there is NO distinction between valid vs. allocated space, but Microsoft nevertheless has a SetFileValidData thing that allows for setting valid (therefore occupied) space. Since it leaks raw data on disk, it requires admin privileges, but still it is faster than zero filling and whatnot. (And let's face it, 80% of Windows users use admin privs.)
Aria2 has an example:
https://github.com/aria2/aria2/blob/e0a827f/src/AbstractDiskWriter.cc#L519-L530
Windows has pretty shabby support for fallocate; by that I am saying there is NO distinction between valid vs. allocated space, but Microsoft nevertheless has a SetFileValidData thing that allows for setting valid (therefore occupied) space. Since it leaks raw data on disk, it requires admin privileges, but still it is faster than zero filling and whatnot. (And let's face it, 80% of Windows users use admin privs.)
Aria2 has an example:
https://github.com/aria2/aria2/blob/e0a827f/src/AbstractDiskWriter.cc#L519-L530