//go:build !windows package console import "syscall" // scratchFree is the bytes available to the console on dir's filesystem. // Bavail times Bsize, multiplied once here (Bsize is int64 on Linux and // uint32 on darwin, internal/host/statfs_unix.go's note). func scratchFree(dir string) (int64, error) { var st syscall.Statfs_t if err := syscall.Statfs(dir, &st); err != nil { return 0, err } return int64(uint64(st.Bavail) * uint64(st.Bsize)), nil }