Go disk_available_space

1 개요[ | ]

Go disk_free_space
Go disk_avail_space
Go disk_available_space
Go
Copy
package main

import (
	"fmt"
	"os"

	"golang.org/x/sys/unix"
)

func main() {
	var stat unix.Statfs_t
	wd, _ := os.Getwd()
	unix.Statfs(wd, &stat)
	fmt.Println(stat.Bfree * uint64(stat.Bsize))
	fmt.Println(stat.Bavail * uint64(stat.Bsize)) // ★
}
Loading

2 같이 보기[ | ]