@@ -139,18 +139,24 @@ status copy_backup_files(const boost::filesystem::path& from_dir, const std::vec
139139 }
140140 try {
141141 if (!resolver.is_blob_file (src)) {
142- // overwrite if destination exists
143- boost::filesystem::copy_file (src, location / dst, boost::filesystem::copy_options::overwrite_existing);
142+ std::filesystem::copy_file (
143+ std::filesystem::path{src.string ()},
144+ std::filesystem::path{(location / dst).string ()},
145+ std::filesystem::copy_options::overwrite_existing
146+ );
144147 } else {
145148 boost::filesystem::path full_dst = resolver.resolve_path (resolver.extract_blob_id (src));
146149 boost::filesystem::path dst_dir = full_dst.parent_path ();
147150 if (!boost::filesystem::exists (dst_dir)) {
148151 boost::filesystem::create_directories (dst_dir);
149152 }
150- // overwrite blob file if destination exists
151- boost::filesystem::copy_file (src, full_dst, boost::filesystem::copy_options::overwrite_existing);
153+ std::filesystem::copy_file (
154+ std::filesystem::path{src.string ()},
155+ std::filesystem::path{full_dst.string ()},
156+ std::filesystem::copy_options::overwrite_existing
157+ );
152158 }
153- } catch (boost ::filesystem::filesystem_error& ex) {
159+ } catch (std ::filesystem::filesystem_error& ex) {
154160 LOG_LP (ERROR ) << ex.what () << " file = " << src.string ();
155161 return status::err_permission_error;
156162 }
@@ -209,18 +215,24 @@ status datastore::restore(std::string_view from, bool keep_backup, bool purge_de
209215 }
210216
211217 if (!resolver.is_blob_file (p)) {
212- // overwrite destination file if exists
213- boost::filesystem::copy_file (p, location_ / p.filename (), boost::filesystem::copy_options::overwrite_existing);
218+ std::filesystem::copy_file (
219+ std::filesystem::path{p.string ()},
220+ std::filesystem::path{(location_ / p.filename ()).string ()},
221+ std::filesystem::copy_options::overwrite_existing
222+ );
214223 } else {
215224 boost::filesystem::path full_dst = resolver.resolve_path (resolver.extract_blob_id (p));
216225 boost::filesystem::path dst_dir = full_dst.parent_path ();
217226 if (!boost::filesystem::exists (dst_dir)) {
218227 boost::filesystem::create_directories (dst_dir);
219228 }
220- // overwrite blob file if exists
221- boost::filesystem::copy_file (p, full_dst, boost::filesystem::copy_options::overwrite_existing);
229+ std::filesystem::copy_file (
230+ std::filesystem::path{p.string ()},
231+ std::filesystem::path{full_dst.string ()},
232+ std::filesystem::copy_options::overwrite_existing
233+ );
222234 }
223- } catch (boost ::filesystem::filesystem_error& ex) {
235+ } catch (std ::filesystem::filesystem_error& ex) {
224236 LOG_LP (ERROR ) << ex.what () << " file = " << p.string ();
225237 return status::err_permission_error;
226238 }
0 commit comments