2024-08-06 17:46:31 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"golang.org/x/sys/windows"
|
|
|
|
)
|
|
|
|
|
2024-08-09 18:57:48 +00:00
|
|
|
func setSparse(file *os.File) {
|
|
|
|
// exFat (and other FS types) don't support sparse files, so ignore errors
|
|
|
|
windows.DeviceIoControl( //nolint:errcheck
|
2024-08-06 17:46:31 +00:00
|
|
|
windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE,
|
|
|
|
nil, 0,
|
|
|
|
nil, 0,
|
|
|
|
nil, nil,
|
|
|
|
)
|
|
|
|
}
|