mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-27 09:05:18 +00:00
18 lines
260 B
Go
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)
|
|
}
|