summaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp')
-rw-r--r--searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp b/searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp
index cc2575f74d2..54d2cf6e1f5 100644
--- a/searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp
+++ b/searchcore/src/vespa/searchcorespi/index/indexwriteutilities.cpp
@@ -7,7 +7,9 @@
#include <vespa/fastlib/io/bufferedfile.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <filesystem>
#include <sstream>
+#include <system_error>
#include <unistd.h>
#include <vespa/log/log.h>
@@ -80,7 +82,10 @@ IndexWriteUtilities::copySerialNumFile(const vespalib::string &sourceDir,
vespalib::string source = IndexDiskLayout::getSerialNumFileName(sourceDir);
vespalib::string dest = IndexDiskLayout::getSerialNumFileName(destDir);
vespalib::string tmpDest = dest + ".tmp";
- if (!FastOS_FileInterface::CopyFile(source.c_str(), tmpDest.c_str())) {
+ std::error_code ec;
+
+ std::filesystem::copy_file(std::filesystem::path(source), std::filesystem::path(tmpDest), ec);
+ if (ec) {
LOG(error, "Unable to copy file '%s'", source.c_str());
return false;
}