diff --git a/src/OSTPlatform/Windows/DirectoryWatch.cpp b/src/OSTPlatform/Windows/DirectoryWatch.cpp index bea136b..a4096a1 100644 --- a/src/OSTPlatform/Windows/DirectoryWatch.cpp +++ b/src/OSTPlatform/Windows/DirectoryWatch.cpp @@ -98,7 +98,7 @@ bool Watch::IssueRead() { impl_->dir.get(), impl_->buffer.data(), static_cast(impl_->buffer.size()), - FALSE, + TRUE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE, &dummy, &impl_->overlapped, diff --git a/src/Utils/Config/LuaConfig.cpp b/src/Utils/Config/LuaConfig.cpp index 905fa12..323e56b 100644 --- a/src/Utils/Config/LuaConfig.cpp +++ b/src/Utils/Config/LuaConfig.cpp @@ -689,11 +689,21 @@ namespace LuaConfig{ if (!std::filesystem::exists(directory, ec) || !std::filesystem::is_directory(directory, ec)) return files; - for (const auto& entry : std::filesystem::directory_iterator(directory, ec)) { - if (ec) break; - if (!entry.is_regular_file()) continue; - if (entry.path().extension() != ".lua") continue; - files.push_back(entry.path().string()); + std::vector pending = { std::filesystem::path(directory) }; + while (!pending.empty()) { + std::filesystem::path current = pending.back(); + pending.pop_back(); + + std::error_code dec; + for (const auto& entry : std::filesystem::directory_iterator(current, dec)) { + if (dec) break; + std::error_code fec; + if (entry.is_directory(fec)) { + pending.push_back(entry.path()); + } else if (entry.is_regular_file(fec) && entry.path().extension() == ".lua") { + files.push_back(entry.path().string()); + } + } } return files; }