summaryrefslogtreecommitdiff
path: root/libgo/go/os/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/os/error.go')
-rw-r--r--libgo/go/os/error.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/libgo/go/os/error.go b/libgo/go/os/error.go
index e0b83b5c22c..b88e49400de 100644
--- a/libgo/go/os/error.go
+++ b/libgo/go/os/error.go
@@ -42,3 +42,21 @@ func NewSyscallError(syscall string, err error) error {
}
return &SyscallError{syscall, err}
}
+
+// IsExist returns whether the error is known to report that a file or directory
+// already exists. It is satisfied by ErrExist as well as some syscall errors.
+func IsExist(err error) bool {
+ return isExist(err)
+}
+
+// IsNotExist returns whether the error is known to report that a file or directory
+// does not exist. It is satisfied by ErrNotExist as well as some syscall errors.
+func IsNotExist(err error) bool {
+ return isNotExist(err)
+}
+
+// IsPermission returns whether the error is known to report that permission is denied.
+// It is satisfied by ErrPermission as well as some syscall errors.
+func IsPermission(err error) bool {
+ return isPermission(err)
+}