Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Code

527 commit(s) on main

Put job execution behind an interface Keenan Nemetz · 2h ago de3eec16
history blame raw 626 B
1//go:build windows
2
3package agent
4
5import "golang.org/x/sys/windows"
6
7// freeBytes reports how many bytes are available to this user on the volume
8// holding dir. freeBytesAvailableToCaller is GetDiskFreeSpaceEx's first answer and
9// the one that respects a quota on the account, which is the bound the runner is
10// trying to respect.
11func freeBytes(dir string) (int64, error) {
12 p, err := windows.UTF16PtrFromString(dir)
13 if err != nil {
14 return 0, err
15 }
16 var available, total, free uint64
17 if err := windows.GetDiskFreeSpaceEx(p, &available, &total, &free); err != nil {
18 return 0, err
19 }
20 return int64(available), nil
21}
22