diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-08-31 12:22:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 12:22:01 +0200 |
commit | 7d53cea7e9f25c775bb6bb691ed0db80f4e81648 (patch) | |
tree | da7497d6959e945e9003ead1de48761992138e0e /searchcore | |
parent | 924b8c9f16c6c224a694a6127b24ef679db4c00d (diff) | |
parent | 987900671c5e949dee4a465bff975e2b864f5fd7 (diff) |
Merge pull request #28304 from vespa-engine/toregge/use-std-filesystem-directory-iterator-in-file-config-manager
Use std::filesystem::directory_iterator in FileConfigManager.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp index e4a4e6761aa..a535d180622 100644 --- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp @@ -17,7 +17,6 @@ #include <vespa/config-summary.h> #include <vespa/searchsummary/config/config-juniperrc.h> #include <vespa/config/helper/configgetter.hpp> -#include <vespa/fastos/file.h> #include <filesystem> #include <sstream> #include <cassert> @@ -193,12 +192,9 @@ std::vector<vespalib::string> getFileList(const vespalib::string &snapDir) { std::vector<vespalib::string> res; - FastOS_DirectoryScan dirScan(snapDir.c_str()); - while (dirScan.ReadNext()) { - if (strcmp(dirScan.GetName(), ".") == 0 || - strcmp(dirScan.GetName(), "..") == 0) - continue; - res.push_back(dirScan.GetName()); + std::filesystem::directory_iterator dir_scan{std::filesystem::path(snapDir)}; + for (auto& entry : dir_scan) { + res.emplace_back(entry.path().filename().string()); } std::sort(res.begin(), res.end()); return res; |