This commit is contained in:
Mechiel Lukkien
2023-01-30 14:27:06 +01:00
commit cb229cb6cf
1256 changed files with 491723 additions and 0 deletions

14
moxio/storagespace.go Normal file
View File

@ -0,0 +1,14 @@
package moxio
import (
"errors"
"syscall"
)
// In separate file because of syscall import.
// IsStorageSpace returns whether the error is for storage space issue.
// Like disk full, no inodes, quota reached.
func IsStorageSpace(err error) bool {
return errors.Is(err, syscall.ENOSPC) || errors.Is(err, syscall.EDQUOT)
}