함수 disk_available_space()

(함수 disk free space()에서 넘어옴)

1 개요[ | ]

함수 disk_free_space()
함수 disk_avail_space()
함수 disk_available_space()

2 Bash[ | ]

Bash
Copy
df --block-size=1 --output=avail / | sed 1d
Loading

3 Go[ | ]

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.Bavail * uint64(stat.Bsize))
}
Loading

4 PHP[ | ]

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

5 같이 보기[ | ]