ceremonyclient/utils/selftest_intrinsics_windows.go
Cassandra Heart dbd95bd9e9
v2.1.0 (#439)
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete

* 2.1.0 main node rollup
2025-09-30 02:48:15 -05:00

26 lines
499 B
Go

//go:build windows
// +build windows
package utils
import (
"log"
"go.uber.org/zap"
"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 {
log.Panic("failed GetDiskFreeSpaceEx", zap.Error(err))
}
return totalNumberOfBytes
}