mirror of
https://github.com/rclone/rclone.git
synced 2024-11-24 17:34:57 +01:00
17 lines
380 B
Go
17 lines
380 B
Go
//go:build windows
|
|
|
|
package diskusage
|
|
|
|
import (
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
// New returns the disk status for dir.
|
|
//
|
|
// May return Unsupported error if it doesn't work on this platform.
|
|
func New(dir string) (info Info, err error) {
|
|
dir16 := windows.StringToUTF16Ptr(dir)
|
|
err = windows.GetDiskFreeSpaceEx(dir16, &info.Available, &info.Total, &info.Free)
|
|
return info, err
|
|
}
|