mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 00:25:17 +00:00
21 lines
423 B
Go
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
|
||
|
}
|