+func FileExists(p string) bool {
+ if exists, known := FileExistsCache[p]; known {
+ return exists
+ }
+ _, err := os.Stat(p)
+ if err == nil {
+ FileExistsCache[p] = true
+ return true
+ }
+ if os.IsNotExist(err) {
+ FileExistsCache[p] = false
+ }
+ return false
+}
+