mirror of
https://github.com/restic/restic.git
synced 2025-08-23 13:08:08 +00:00
restorer: pre-allocate files before loading chunks
This commit is contained in:
11
internal/restorer/preallocate_other.go
Normal file
11
internal/restorer/preallocate_other.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// +build !linux,!darwin
|
||||
|
||||
package restorer
|
||||
|
||||
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