sparse_windows.go 307 B

1234567891011121314151617
  1. package server
  2. import (
  3. "os"
  4. "golang.org/x/sys/windows"
  5. )
  6. func setSparse(file *os.File) {
  7. // exFat (and other FS types) don't support sparse files, so ignore errors
  8. windows.DeviceIoControl( //nolint:errcheck
  9. windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE,
  10. nil, 0,
  11. nil, 0,
  12. nil, nil,
  13. )
  14. }