build diskfree on all platforms

cc #1168
This commit is contained in:
Gokcehan committed 2023-04-30 22:10:15 +03:00
1 parent 2c86577b95
commit f04401ba4d
6 files changed
+84 -27

No files matched your search

-16
View File
@@ -184,19 +184,3 @@ func exportFiles(f string, fs []string, pwd string) {
os.Setenv("fx", envFiles)
}
}
func diskFree(wd string) string {
var free uint64
pathPtr, err := windows.UTF16PtrFromString(wd)
if err != nil {
log.Printf("diskfree: %s", err)
return ""
}
err = windows.GetDiskFreeSpaceEx(pathPtr, &free, nil, nil) // cwd, free, total, available
if err != nil {
log.Printf("diskfree: %s", err)
return ""
}
return "df: " + humanize(int64(free))
}