// FileExists returns whether or not a file exists at the specified path. If dir is true, FileExists checks for the existence
// of the specified directory.
FileExists returns whether or not a file exists at the specified path. If dir is true, FileExists checks for the existence
of the specified directory.
// FileExists returns whether or not a file exists at the specified path . If dir is true FileExists checks for the existence // of the specified directory .
func FileExists(path string, dir bool) (bool, error) {
	if f, err := os.Stat(path); err == nil {
		if f.IsDir() != dir {
			return false, nil
		}
		return true, nil
	} else if os.IsNotExist(err) {
		return false, nil
	} else {
		return false, err
	}
}
func FileExists ( path string , dir bool ) ( bool , error ) { if f , err := os . Stat ( path ) ; err == nil { if f . IsDir ( ) != dir { return false , nil } return true , nil } else if os . IsNotExist ( err ) { return false , nil } else { return false , err } }
FileExists returns whether or not a file exists at the specified path.
FileExists returns whether or not a file exists at the specified path .