summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-08-31 11:14:15 +0200
committerTor Egge <Tor.Egge@online.no>2023-08-31 11:14:15 +0200
commit987900671c5e949dee4a465bff975e2b864f5fd7 (patch)
tree237a0cf77030d7dbd3de7a46f29ceb298a81f79d /searchcore
parent8ea84bc51e83f76f2b77ba98b49e4d03b0351214 (diff)
Use std::filesystem::directory_iterator in FileConfigManager.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp10
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;