Exists returns true if the shutdown marker file exists on the given path, false otherwise
(p string)
| 44 | |
| 45 | // Exists returns true if the shutdown marker file exists on the given path, false otherwise |
| 46 | func Exists(p string) (bool, error) { |
| 47 | s, err := os.Stat(p) |
| 48 | if err != nil && os.IsNotExist(err) { |
| 49 | return false, nil |
| 50 | } |
| 51 | |
| 52 | if err != nil { |
| 53 | return false, err |
| 54 | } |
| 55 | |
| 56 | return s.Mode().IsRegular(), nil |
| 57 | } |
| 58 | |
| 59 | // GetPath returns the absolute path of the shutdown marker file |
| 60 | func GetPath(dirPath string) string { |
no outgoing calls
no test coverage detected