]> Cypherpunks.ru repositories - nncp.git/blob - src/df.go
Raise copyright years
[nncp.git] / src / df.go
1 //go:build !netbsd
2 // +build !netbsd
3
4 // NNCP -- Node to Node copy, utilities for store-and-forward data exchange
5 // Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
6
7 package nncp
8
9 import (
10         "log"
11
12         "golang.org/x/sys/unix"
13 )
14
15 func (ctx *Ctx) IsEnoughSpace(want int64) bool {
16         var s unix.Statfs_t
17         if err := unix.Statfs(ctx.Spool, &s); err != nil {
18                 log.Fatalln("Can not stat spool:", err)
19         }
20         return int64(s.Bavail)*int64(s.Bsize) > want
21 }