1 개요[ | ]
- 함수 disk_used_space()
2 Bash[ | ]

Bash
Copy
df --block-size=1 --output=used / | sed 1d
Loading
3 Go[ | ]

Go
Copy
package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main() {
var stat unix.Statfs_t
unix.Statfs("/", &stat)
fmt.Println((stat.Blocks - stat.Bavail) * uint64(stat.Bsize))
}
Loading
4 PHP[ | ]

PHP
Copy
<?php
echo disk_total_space("/")-disk_free_space("/");
Loading