mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
* 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
26 lines
499 B
Go
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
|
|
}
|