feat: initial commit — unarr CLI
Search, inspect, stream, and download torrents from the terminal. Replaces the entire *arr stack with a single binary.
This commit is contained in:
commit
29cf0a0126
85 changed files with 10178 additions and 0 deletions
17
internal/agent/disk_unix.go
Normal file
17
internal/agent/disk_unix.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//go:build !windows
|
||||
|
||||
package agent
|
||||
|
||||
import "syscall"
|
||||
|
||||
// DiskInfo returns free and total bytes for the filesystem containing path.
|
||||
func DiskInfo(path string) (freeBytes, totalBytes int64, err error) {
|
||||
var stat syscall.Statfs_t
|
||||
if err := syscall.Statfs(path, &stat); err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
// Available blocks * block size
|
||||
freeBytes = int64(stat.Bavail) * int64(stat.Bsize)
|
||||
totalBytes = int64(stat.Blocks) * int64(stat.Bsize)
|
||||
return freeBytes, totalBytes, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue