Home | History | Annotate | Download | only in os
      1 // Copyright 2009 The Go Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style
      3 // license that can be found in the LICENSE file.
      4 
      5 // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
      6 
      7 package os
      8 
      9 import "syscall"
     10 
     11 func isExist(err error) bool {
     12 	err = underlyingError(err)
     13 	return err == syscall.EEXIST || err == syscall.ENOTEMPTY || err == ErrExist
     14 }
     15 
     16 func isNotExist(err error) bool {
     17 	err = underlyingError(err)
     18 	return err == syscall.ENOENT || err == ErrNotExist
     19 }
     20 
     21 func isPermission(err error) bool {
     22 	err = underlyingError(err)
     23 	return err == syscall.EACCES || err == syscall.EPERM || err == ErrPermission
     24 }
     25