#include "ehs/io/Directory_LNX.h" #include "ehs/Log.h" #include namespace ehs { Array Directory::GetAllFiles(const Str_8& dir) { Array result; DIR* hdl = opendir(dir); if (!dir) { EHS_LOG_INT("Error", 0, "Failed to open directory, \"" + dir + "\"."); return result; } dirent* entry; while ((entry = readdir(hdl))) if (entry->d_type == DT_REG) result.Push(entry->d_name); closedir(hdl); return result; } }