mirror of
https://github.com/restic/restic.git
synced 2025-12-04 03:38:25 +00:00
Move PreallocateFile to fs package
This commit is contained in:
12
internal/fs/preallocate_other.go
Normal file
12
internal/fs/preallocate_other.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user