summaryrefslogtreecommitdiff
path: root/libgo/go/os/error.go
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-04-03 11:15:51 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-04-03 11:15:51 -0700
commitc924cab2fd8932bdfb107c4ca7d26128ba56f19e (patch)
tree0eea6430e211564fc331f66625373ec761837982 /libgo/go/os/error.go
parent4c15f6d5728cb694d7d954b2c20409fdc0400b9e (diff)
parent3cef948a814542119083003a3c35a24e036230b6 (diff)
downloadgcc-hjl/x32/addr32.tar.gz
Merge remote-tracking branch 'origin/master' into hjl/x32/addr32hjl/x32/addr32
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)
+}