Atomic small-text write (.tmp + rename) into local storage.
| 2147 | |
| 2148 | // Atomic small-text write (.tmp + rename) into local storage. |
| 2149 | static bool WriteLocalText(const std::string& path, const std::string& content) { |
| 2150 | auto parent = FileUtil::Utf8ToPath(path).parent_path(); |
| 2151 | std::error_code ec; |
| 2152 | std::filesystem::create_directories(parent, ec); |
| 2153 | if (ec) { |
| 2154 | LOG("[CloudStorage] WriteLocalText: failed to create parent %s: %s", |
| 2155 | FileUtil::PathToUtf8(parent).c_str(), ec.message().c_str()); |
| 2156 | return false; |
| 2157 | } |
| 2158 | return FileUtil::AtomicWriteText(path, content); |
| 2159 | } |
| 2160 | |
| 2161 | |
| 2162 |
nothing calls this directly
no test coverage detected