diff options
Diffstat (limited to 'internal/fs/preallocate_other.go')
-rw-r--r-- | internal/fs/preallocate_other.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/fs/preallocate_other.go b/internal/fs/preallocate_other.go new file mode 100644 index 000000000..4fb44d421 --- /dev/null +++ b/internal/fs/preallocate_other.go @@ -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) +} |