s3 support

This commit is contained in:
onysd 2026-08-04 23:09:11 +03:00
parent fa5cfaf14d
commit 03f10b66ee
53 changed files with 2796 additions and 102 deletions

View file

@ -0,0 +1,15 @@
//go:build !windows
package files
import "golang.org/x/sys/unix"
// localDiskFreeBytes returns free (available to an unprivileged writer, not
// counting reserved blocks) and total bytes for the filesystem containing path.
func localDiskFreeBytes(path string) (free, total int64, err error) {
var st unix.Statfs_t
if err := unix.Statfs(path, &st); err != nil {
return 0, 0, err
}
return int64(st.Bavail) * int64(st.Bsize), int64(st.Blocks) * int64(st.Bsize), nil
}