1
0
Fork 0
mirror of https://github.com/mjl-/mox.git synced 2025-02-03 09:48:31 +03:00
mox/moxio/storagespace.go
Mechiel Lukkien cb229cb6cf
mox!
2023-01-30 14:27:06 +01:00

14 lines
326 B
Go

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)
}