"Go disk available space"의 두 판 사이의 차이

(새 문서: ==Go== ;Go disk_free_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()...)
 
 
(같은 사용자의 중간 판 7개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==Go==
==개요==
{{DISPLAYTITLE:Go disk_available_space}}
;Go disk_free_space
;Go disk_free_space
;Go disk_avail_space
;Go disk_available_space
<syntaxhighlight lang='go' run>
<syntaxhighlight lang='go' run>
package main
package main
15번째 줄: 19번째 줄:
wd, _ := os.Getwd()
wd, _ := os.Getwd()
unix.Statfs(wd, &stat)
unix.Statfs(wd, &stat)
fmt.Println(stat.Bavail * uint64(stat.Bsize))
fmt.Println(stat.Bfree * uint64(stat.Bsize))
fmt.Println(stat.Bavail * uint64(stat.Bsize)) // ★
}
}
</syntaxhighlight>
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[Go disk_total_space]]
* [[Go disk_used_space]]
* [[함수 disk_free_space()]]
* [[함수 disk_free_space()]]


[[분류: 파일시스템]]
[[분류: 파일시스템]]

2023년 2월 26일 (일) 17:31 기준 최신판

1 개요[ | ]

Go disk_free_space
Go disk_avail_space
Go disk_available_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.Bfree * uint64(stat.Bsize))
	fmt.Println(stat.Bavail * uint64(stat.Bsize)) // ★
}

2 같이 보기[ | ]

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