diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-06-02 16:35:21 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-06-02 19:22:21 +0200 |
commit | 914317d3db05758483eaea09a60ef8bfa3981948 (patch) | |
tree | 7b94d14f6215b8b66becb869e1b08c59d81a05e6 /searchcore/src/apps | |
parent | a51340034f1b4bc98096613af8f5736a2c974c96 (diff) |
Remove most use of vespalib::rmdir in searchcore.
Diffstat (limited to 'searchcore/src/apps')
4 files changed, 11 insertions, 11 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index 386ceb4eeda..2f69bcece66 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -6,13 +6,13 @@ #include <vespa/vespalib/util/signalhandler.h> #include <vespa/vespalib/util/programoptions.h> #include <vespa/vespalib/util/size_literals.h> -#include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/config/common/exceptions.h> #include <vespa/config/common/configcontext.h> #include <vespa/fnet/transport.h> #include <vespa/fastos/thread.h> #include <vespa/fastos/file.h> +#include <filesystem> #include <iostream> #include <thread> #include <fcntl.h> @@ -239,7 +239,7 @@ App::startAndRun(FastOS_ThreadPool & threadPool, FNET_Transport & transport, int } else { const ProtonConfig &protonConfig = configSnapshot->getProtonConfig(); vespalib::string basedir = protonConfig.basedir; - vespalib::mkdir(basedir, true); + std::filesystem::create_directories(std::filesystem::path(basedir)); { ExitOnSignal exit_on_signal; proton.init(configSnapshot); diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index 64db35b7acb..b489a07bba2 100644 --- a/searchcore/src/apps/tests/persistenceconformance_test.cpp +++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp @@ -38,8 +38,8 @@ #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/transactionlog/translogserver.h> #include <vespa/searchsummary/config/config-juniperrc.h> -#include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/util/size_literals.h> +#include <filesystem> #include <vespa/log/log.h> LOG_SETUP("persistenceconformance_test"); @@ -190,8 +190,8 @@ public: const DocTypeName &docType, const ConfigFactory &factory) { DocumentDBConfig::SP snapshot = factory.create(docType); - vespalib::mkdir(_baseDir, false); - vespalib::mkdir(_baseDir + "/" + docType.toString(), false); + std::filesystem::create_directory(std::filesystem::path(_baseDir)); + std::filesystem::create_directory(std::filesystem::path(_baseDir + "/" + docType.toString())); vespalib::string inputCfg = _baseDir + "/" + docType.toString() + "/baseconfig"; { FileConfigManager fileCfg(_shared_service.transport(), inputCfg, "", docType.getName()); diff --git a/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp b/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp index 9a4922c42fc..df0827e78c9 100644 --- a/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp +++ b/searchcore/src/apps/vespa-feed-bm/vespa_feed_bm.cpp @@ -20,12 +20,12 @@ #include <vespa/searchcore/bmcluster/bucket_selector.h> #include <vespa/searchcore/bmcluster/spi_bm_feed_handler.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> -#include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/util/lambdatask.h> #include <vespa/vespalib/util/size_literals.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <getopt.h> +#include <filesystem> #include <iostream> #include <thread> #include <unistd.h> @@ -391,7 +391,7 @@ App::main(int argc, char **argv) usage(); return 1; } - vespalib::rmdir(base_dir, true); + std::filesystem::remove_all(std::filesystem::path(base_dir)); Benchmark bm(_bm_params); bm.run(); return 0; @@ -402,6 +402,6 @@ int main(int argc, char **argv) { DummyFileHeaderContext::setCreator("vespa-feed-bm"); App app; auto exit_value = app.main(argc, argv); - vespalib::rmdir(base_dir, true); + std::filesystem::remove_all(std::filesystem::path(base_dir)); return exit_value; } diff --git a/searchcore/src/apps/vespa-redistribute-bm/vespa_redistribute_bm.cpp b/searchcore/src/apps/vespa-redistribute-bm/vespa_redistribute_bm.cpp index 40847baa719..f22e817b72c 100644 --- a/searchcore/src/apps/vespa-redistribute-bm/vespa_redistribute_bm.cpp +++ b/searchcore/src/apps/vespa-redistribute-bm/vespa_redistribute_bm.cpp @@ -22,13 +22,13 @@ #include <vespa/searchcore/bmcluster/bucket_selector.h> #include <vespa/searchcore/bmcluster/spi_bm_feed_handler.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> -#include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/lambdatask.h> #include <vespa/vespalib/util/size_literals.h> #include <vespa/vespalib/util/threadstackexecutor.h> #include <getopt.h> +#include <filesystem> #include <iostream> #include <thread> #include <unistd.h> @@ -670,7 +670,7 @@ App::main(int argc, char **argv) usage(); return 1; } - vespalib::rmdir(base_dir, true); + std::filesystem::remove_all(std::filesystem::path(base_dir)); Benchmark bm(_bm_params); bm.run(); return 0; @@ -681,6 +681,6 @@ int main(int argc, char **argv) { DummyFileHeaderContext::setCreator("vespa-redistribute-bm"); App app; auto exit_value = app.main(argc, argv); - vespalib::rmdir(base_dir, true); + std::filesystem::remove_all(std::filesystem::path(base_dir)); return exit_value; } |