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

21 lines
423 B
Go

//go:build windows
// +build windows
package utils
import "golang.org/x/sys/windows"
func GetDiskSpace(dir string) uint64 {
var freeBytesAvailable uint64
var totalNumberOfBytes uint64
var totalNumberOfFreeBytes uint64
err := windows.GetDiskFreeSpaceEx(windows.StringToUTF16Ptr(dir),
&freeBytesAvailable, &totalNumberOfBytes, &totalNumberOfFreeBytes)
if err != nil {
panic(err)
}
return totalNumberOfBytes
}