[Agent][Operator] - DLTU bug fix

This commit is contained in:
zeaslity
2024-05-08 17:03:08 +08:00
parent 25e0c904f9
commit f1b432fc3a
4 changed files with 86 additions and 33 deletions

View File

@@ -131,6 +131,15 @@ func IsDirOrFile(path string) bool {
// FileExists 文件存在返回true不存在返回false如果文件是一个目录也返回false
func FileExists(fileFullPath string) bool {
info, err := os.Stat(fileFullPath)
if err != nil {
return false
}
return !info.IsDir()
}
// FileOrFolderExists 文件或者目录是否返回true不存在返回false
func FileOrFolderExists(fileFullPath string) bool {
_, err := os.Stat(fileFullPath)
return err == nil
}