MCPcopy Create free account
hub / github.com/78/tenbox / CopyFileChecked

Function CopyFileChecked

src/manager/manager_service.cpp:120–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120bool CopyFileChecked(const std::string& src, const std::string& dst, std::string* error) {
121 if (src.empty()) return true;
122 std::error_code ec;
123 if (!fs::exists(src, ec)) {
124 if (error) *error = "source file not found: " + src;
125 return false;
126 }
127 fs::copy_file(src, dst, fs::copy_options::overwrite_existing, ec);
128 if (ec) {
129 if (error) *error = "failed to copy " + src + " -> " + dst + ": " + ec.message();
130 return false;
131 }
132 return true;
133}
134
135} // namespace
136

Callers 1

CreateVmMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected