MCPcopy Create free account
hub / github.com/bcndev/bytecoin / save_file

Function save_file

src/platform/PathTools.cpp:309–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309bool save_file(const std::string &filepath, const void *buf, size_t size) {
310 try {
311 FileStream fs(filepath, platform::O_CREATE_ALWAYS);
312 fs.write(buf, size);
313 } catch (const std::exception &) {
314 return false;
315 }
316 return true;
317}
318bool atomic_save_file(const std::string &filepath, const void *buf, size_t size, const std::string &tmp_filepath) {
319 try {
320 FileStream fs(tmp_filepath, platform::O_CREATE_ALWAYS);

Callers 1

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected