Move PreallocateFile to fs package

This commit is contained in:
DRON-666
2021-02-02 17:43:40 +03:00
parent 88c63a029c
commit ffc6b3d887
5 changed files with 11 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
//go:build !linux && !darwin
// +build !linux,!darwin
package fs
import "os"
func PreallocateFile(wr *os.File, size int64) error {
// Maybe truncate can help?
// Windows: This calls SetEndOfFile which preallocates space on disk
return wr.Truncate(size)
}