mirror of
https://github.com/rclone/rclone.git
synced 2024-11-23 08:54:10 +01:00
24 lines
387 B
Go
24 lines
387 B
Go
|
// +build !plan9
|
||
|
|
||
|
package fserrors
|
||
|
|
||
|
import (
|
||
|
"syscall"
|
||
|
|
||
|
"github.com/rclone/rclone/lib/errors"
|
||
|
)
|
||
|
|
||
|
// IsErrNoSpace checks a possibly wrapped error to
|
||
|
// see if it contains a ENOSPC error
|
||
|
func IsErrNoSpace(cause error) (isNoSpc bool) {
|
||
|
errors.Walk(cause, func(c error) bool {
|
||
|
if c == syscall.ENOSPC {
|
||
|
isNoSpc = true
|
||
|
return true
|
||
|
}
|
||
|
isNoSpc = false
|
||
|
return false
|
||
|
})
|
||
|
return
|
||
|
}
|