MCPcopy Create free account
hub / github.com/ElementsProject/elements / RenameOver

Function RenameOver

src/util/system.cpp:1117–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1115}
1116
1117bool RenameOver(fs::path src, fs::path dest)
1118{
1119#ifdef __MINGW64__
1120 // This is a workaround for a bug in libstdc++ which
1121 // implements std::filesystem::rename with _wrename function.
1122 // This bug has been fixed in upstream:
1123 // - GCC 10.3: 8dd1c1085587c9f8a21bb5e588dfe1e8cdbba79e
1124 // - GCC 11.1: 1dfd95f0a0ca1d9e6cbc00e6cbfd1fa20a98f312
1125 // For more details see the commits mentioned above.
1126 return MoveFileExW(src.wstring().c_str(), dest.wstring().c_str(),
1127 MOVEFILE_REPLACE_EXISTING) != 0;
1128#else
1129 std::error_code error;
1130 fs::rename(src, dest, error);
1131 return !error;
1132#endif
1133}
1134
1135/**
1136 * Ignores exceptions thrown by create_directories if the requested directory exists.

Callers 6

SerializeFileDBFunction · 0.85
LoadAddrmanFunction · 0.85
DumpMempoolFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
GenerateAuthCookieFunction · 0.85
WriteSettingsFileMethod · 0.85

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68