mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-11-01 10:36:30 +08:00
15 lines
208 B
Go
15 lines
208 B
Go
package local
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func Fallocate(file *os.File, offset int64, length int64) error {
|
|
if length == 0 {
|
|
return nil
|
|
}
|
|
|
|
return syscall.Fallocate(int(file.Fd()), 0, offset, length)
|
|
}
|