Now I want to get the disk usage in golang.I know I can got that by call command "df ", but I want to know is there any other method to get the diskusage status?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda1 20641404 14142760 5450120 73% /
tmpfs 960368 0 960368 0% /dev/shm
/dev/xvdb1 51599192 184268 48793832 1% /alidata1
Hello,
In this thred https://groups.google.com/forum/#!topic/golang-nuts/Ld41Pdk28tY Han-Wen Nienhuys propose :
s := syscall.Statfs_t{}
errNo := syscall.Statfs(ts.orig, &s)
http://golang.org/pkg/syscall/#Statfs
http://golang.org/pkg/syscall/#Statfs_t
Does this work in windows? There's no cross platform way to do this using the std lib, I guess?
--