Go disk total space

Jmnote (토론 | 기여)님의 2023년 2월 26일 (일) 02:20 판 (새 문서: ==Go== ;Go disk_total_space <syntaxhighlight lang='go' run> package main import ( "fmt" "os" "golang.org/x/sys/unix" ) func main() { var stat unix.Statfs_t wd, _ := os.Getwd()...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 Go[ | ]

Go disk_total_space
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.Blocks * uint64(stat.Bsize))
}


2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}