| 558 | } |
| 559 | |
| 560 | bool ArgsManager::WriteSettingsFile(std::vector<std::string>* errors) const |
| 561 | { |
| 562 | fs::path path, path_tmp; |
| 563 | if (!GetSettingsPath(&path, /* temp= */ false) || !GetSettingsPath(&path_tmp, /* temp= */ true)) { |
| 564 | throw std::logic_error("Attempt to write settings file when dynamic settings are disabled."); |
| 565 | } |
| 566 | |
| 567 | LOCK(cs_args); |
| 568 | std::vector<std::string> write_errors; |
| 569 | if (!util::WriteSettings(path_tmp, m_settings.rw_settings, write_errors)) { |
| 570 | SaveErrors(write_errors, errors); |
| 571 | return false; |
| 572 | } |
| 573 | if (!RenameOver(path_tmp, path)) { |
| 574 | SaveErrors({strprintf("Failed renaming settings file %s to %s\n", fs::PathToString(path_tmp), fs::PathToString(path))}, errors); |
| 575 | return false; |
| 576 | } |
| 577 | return true; |
| 578 | } |
| 579 | |
| 580 | bool ArgsManager::IsArgNegated(const std::string& strArg) const |
| 581 | { |