MCPcopy Create free account
hub / github.com/apple/foundationdb / writeFileBytes

Function writeFileBytes

flow/Platform.actor.cpp:2989–2997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2987}
2988
2989void writeFileBytes(std::string const& filename, const uint8_t* data, size_t count) {
2990 std::ofstream ofs(filename, std::fstream::out | std::fstream::binary);
2991 if (!ofs.good()) {
2992 TraceEvent("WriteFileBytes_FileOpenError").detail("Filename", filename).GetLastError();
2993 throw io_error();
2994 }
2995
2996 ofs.write((const char*)data, count);
2997}
2998
2999void writeFile(std::string const& filename, std::string const& content) {
3000 writeFileBytes(filename, (const uint8_t*)(content.c_str()), content.size());

Callers 2

writeFileFunction · 0.85
writeMethod · 0.85

Calls 3

TraceEventClass · 0.85
detailMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected