Ensure sparse files on windows during download

The file.Truncate call on windows will write the whole file
unless you set the sparse flag, leading to heavy I/O at the
beginning of download.  This should improve our
I/O behavior on windows and put less stress on the users disk.
This commit is contained in:
Daniel Hiltgen
2024-08-06 10:46:31 -07:00
parent 86b907f82a
commit fc85f50a2b
3 changed files with 28 additions and 0 deletions

9
server/sparse_common.go Normal file
View File

@@ -0,0 +1,9 @@
//go:build !windows
package server
import "os"
func setSparse(file *os.File) error {
return nil
}