Exists returns true only if path exists and is accessible.
(path string)
| 45 | |
| 46 | // Exists returns true only if path exists and is accessible. |
| 47 | func Exists(path string) bool { |
| 48 | _, err := os.Stat(path) |
| 49 | |
| 50 | return !os.IsNotExist(err) |
| 51 | } |
| 52 | |
| 53 | // IsInsideDir checks if path is within directory. |
| 54 | // Both path and directory have to be absolute paths. |