FileExists returns true if a regular file exists at the given path.
(filename string)
| 185 | |
| 186 | // FileExists returns true if a regular file exists at the given path. |
| 187 | func FileExists(filename string) bool { |
| 188 | info, err := os.Stat(filename) |
| 189 | if os.IsNotExist(err) { |
| 190 | return false |
| 191 | } |
| 192 | return !info.IsDir() |
| 193 | } |
| 194 | |
| 195 | // DirExists returns true if a directory exists at the given path. |
| 196 | func DirExists(dirname string) bool { |
no outgoing calls