From 528e7c678054ca8623fee545216dc75c23bfc47b Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 21 Feb 2026 20:49:09 +0800 Subject: [PATCH] tweak legacy library migration from rename to copy in BBLNetworkPlugin (#12400) * tweak legacy library migration from rename to copy in BBLNetworkPlugin --- src/slic3r/Utils/BBLNetworkPlugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/Utils/BBLNetworkPlugin.cpp b/src/slic3r/Utils/BBLNetworkPlugin.cpp index 290de9c32b..e5b621c106 100644 --- a/src/slic3r/Utils/BBLNetworkPlugin.cpp +++ b/src/slic3r/Utils/BBLNetworkPlugin.cpp @@ -77,7 +77,7 @@ int BBLNetworkPlugin::initialize(bool using_backup, const std::string& version) } // Auto-migration: If loading legacy version and versioned library doesn't exist, - // but unversioned legacy library does exist, rename it to versioned format + // but unversioned legacy library does exist, copy it to versioned format if (version == BAMBU_NETWORK_AGENT_VERSION_LEGACY) { boost::filesystem::path versioned_path; boost::filesystem::path legacy_path; @@ -93,9 +93,9 @@ int BBLNetworkPlugin::initialize(bool using_backup, const std::string& version) #endif if (!boost::filesystem::exists(versioned_path) && boost::filesystem::exists(legacy_path)) { try { - boost::filesystem::rename(legacy_path, versioned_path); + boost::filesystem::copy(legacy_path, versioned_path); } catch (const std::exception& e) { - BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to rename legacy library: " << e.what(); + BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to copy legacy library: " << e.what(); } } }