Poco::moveTo to fs version

This commit is contained in:
kssenii 2021-05-12 17:32:22 +03:00
parent 0527f0ea33
commit 17432b1a41

View File

@ -1505,7 +1505,14 @@ void DiskS3::restoreFileOperations(const RestoreInformation & restore_informatio
LOG_DEBUG(log, "Move directory to 'detached' {} -> {}", path, detached_path);
Poco::File(fs::path(metadata_path) / path).moveTo(fs::path(metadata_path) / detached_path);
fs::path from_path = fs::path(metadata_path) / path;
fs::path to_path = fs::path(metadata_path) / detached_path;
if (path.ends_with('/'))
to_path /= from_path.parent_path().filename();
else
to_path /= from_path.filename();
fs::copy(from_path, to_path, fs::copy_options::recursive | fs::copy_options::overwrite_existing);
fs::remove_all(from_path);
}
}