s3 support
This commit is contained in:
parent
fa5cfaf14d
commit
03f10b66ee
53 changed files with 2796 additions and 102 deletions
19
internal/app/files/diskspace_windows.go
Normal file
19
internal/app/files/diskspace_windows.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//go:build windows
|
||||
|
||||
package files
|
||||
|
||||
import "golang.org/x/sys/windows"
|
||||
|
||||
// localDiskFreeBytes returns free (available to the calling user) and total
|
||||
// bytes for the volume containing path.
|
||||
func localDiskFreeBytes(path string) (free, total int64, err error) {
|
||||
ptr, err := windows.UTF16PtrFromString(path)
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
var freeAvail, totalBytes, totalFree uint64
|
||||
if err := windows.GetDiskFreeSpaceEx(ptr, &freeAvail, &totalBytes, &totalFree); err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
return int64(freeAvail), int64(totalBytes), nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue