ceremonyclient/node/utils/selftest_intrinsics_unix.go
Cassandra Heart 7ad553fd62
v1.4.0 (#86)
2024-03-01 01:12:31 -06:00

18 lines
260 B
Go

//go:build !windows
// +build !windows
package utils
import "golang.org/x/sys/unix"
func GetDiskSpace(dir string) uint64 {
var stat unix.Statfs_t
err := unix.Statfs(dir, &stat)
if err != nil {
panic(err)
}
return stat.Bavail * uint64(stat.Bsize)
}