PathExists Check if a file exists.(判断一个文件是否存在)
(path string)
| 124 | |
| 125 | // PathExists Check if a file exists.(判断一个文件是否存在) |
| 126 | func PathExists(path string) (bool, error) { |
| 127 | _, err := os.Stat(path) |
| 128 | if err == nil { |
| 129 | return true, nil |
| 130 | } |
| 131 | if os.IsNotExist(err) { |
| 132 | return false, nil |
| 133 | } |
| 134 | return false, err |
| 135 | } |
| 136 | |
| 137 | // Reload 读取用户的配置文件 |
| 138 | // This method is used to reload the configuration file. |