2
2
mirror of https://github.com/octoleo/restic.git synced 2025-01-22 14:48:24 +00:00
restic/internal/fs/preallocate_other.go

13 lines
261 B
Go
Raw Normal View History

2022-03-28 22:23:47 +02:00
//go:build !linux && !darwin
// +build !linux,!darwin
2021-02-02 17:43:40 +03:00
package fs
import "os"
2021-02-02 17:43:40 +03:00
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)
}