MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / WriteLocalText

Function WriteLocalText

src/common/cloud_storage.cpp:2149–2159  ·  view source on GitHub ↗

Atomic small-text write (.tmp + rename) into local storage.

Source from the content-addressed store, hash-verified

2147
2148// Atomic small-text write (.tmp + rename) into local storage.
2149static 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

Callers

nothing calls this directly

Calls 3

Utf8ToPathFunction · 0.70
PathToUtf8Function · 0.70
AtomicWriteTextFunction · 0.70

Tested by

no test coverage detected