Add funcs ReadDir, Exists.

This commit is contained in:
Сергей Петров 2025-03-27 09:36:13 +05:00
parent 6bc30e63f0
commit 6b15e0f4ae

View File

@ -33,3 +33,13 @@ func ReadDir(dirData string) ([]os.DirEntry, error) {
return files, nil return files, nil
} }
// Exists check if the file or directory exists.
func Exists(path string) bool {
_, err := os.Stat(path)
if err == nil {
return true
}
return false
}