github.com/llir/llvm@v0.3.6/internal/osutil/osutil.go (about)

     1  // Package osutil implements OS utility functions.
     2  package osutil
     3  
     4  import (
     5  	"log"
     6  	"os"
     7  )
     8  
     9  // Exists reports whether the given file or directory exists.
    10  func Exists(path string) bool {
    11  	_, err := os.Stat(path)
    12  	if err == nil {
    13  		return true
    14  	}
    15  	if os.IsNotExist(err) {
    16  		return false
    17  	}
    18  	log.Printf("unable to stat path %q; %v", path, err)
    19  	return false
    20  }