skip non-files (#1690)

This commit is contained in:
David Markowitz 2024-12-19 10:19:41 -08:00 committed by GitHub
parent 0ae9eb4a96
commit 1ae21c423f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -291,11 +291,12 @@ std::u16string GeneralUtils::ReadWString(RakNet::BitStream& inStream) {
std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::string_view folder) { std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::string_view folder) {
// Because we dont know how large the initial number before the first _ is we need to make it a map like so. // Because we dont know how large the initial number before the first _ is we need to make it a map like so.
std::map<uint32_t, std::string> filenames{}; std::map<uint32_t, std::string> filenames{};
for (const auto& t : std::filesystem::directory_iterator(folder)) { for (const auto& t : std::filesystem::directory_iterator(folder)) {
auto filename = t.path().filename().string(); if (t.is_directory() || t.is_symlink()) continue;
const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0)); auto filename = t.path().filename().string();
filenames.emplace(index, std::move(filename)); const auto index = std::stoi(GeneralUtils::SplitString(filename, '_').at(0));
filenames.emplace(index, std::move(filename));
} }
// Now sort the map by the oldest migration. // Now sort the map by the oldest migration.