diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-08-31 11:01:38 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-08-31 11:01:38 +0200 |
commit | 45a5d057789861d5b247b4e4d5e1c889586e392c (patch) | |
tree | 35d41a9cc913c517b187c10a13c1c9996f3cee82 /searchcore | |
parent | 8ea84bc51e83f76f2b77ba98b49e4d03b0351214 (diff) |
Use std::filesystem::directory_iterator in AttributeDiskLayout.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp index 04e263ae20b..40b24f2ec26 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributedisklayout.cpp @@ -3,7 +3,6 @@ #include "attributedisklayout.h" #include "attribute_directory.h" #include <vespa/vespalib/io/fileutil.h> -#include <vespa/fastos/file.h> #include <cassert> #include <filesystem> @@ -34,12 +33,10 @@ AttributeDiskLayout::listAttributes() void AttributeDiskLayout::scanDir() { - FastOS_DirectoryScan dir(_baseDir.c_str()); - while (dir.ReadNext()) { - if (strcmp(dir.GetName(), "..") != 0 && strcmp(dir.GetName(), ".") != 0) { - if (dir.IsDirectory()) { - createAttributeDir(dir.GetName()); - } + std::filesystem::directory_iterator dir_scan{std::filesystem::path(_baseDir)}; + for (auto& entry : dir_scan) { + if (entry.is_directory()) { + createAttributeDir(entry.path().filename().string()); } } } |