func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error {
	if sizeInBytes == 0 {
		return nil
	}
	if extendFile {
		return preallocExtend(f, sizeInBytes)
	}
	return preallocFixed(f, sizeInBytes)
}
Preallocate tries to allocate the space for given
file. This operation is only supported on linux by a
few filesystems (btrfs, ext4, etc.).
If the operation is unsupported, no error will be returned.
Otherwise, the error encountered will be returned.
package fileutil
import (
	"io"
	"os"
)