mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:04:39 +03:00
mox!
This commit is contained in:
14
moxio/storagespace.go
Normal file
14
moxio/storagespace.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user