first commit

This commit is contained in:
2026-06-19 12:32:14 +09:00
commit eb8d9b9460
36 changed files with 6502 additions and 0 deletions

14
httpdl/alloc_other.go Normal file
View File

@@ -0,0 +1,14 @@
//go:build !linux
package httpdl
import "os"
// allocate is the portable fallback: fallocate is Linux-specific, so on other
// platforms prealloc/falloc degrade to a plain truncate.
func allocate(f *os.File, mode string, size int64) error {
if mode == "none" {
return nil
}
return f.Truncate(size)
}