MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / WriteBinaryFile

Function WriteBinaryFile

src/torcontrol.cpp:392–403  ·  view source on GitHub ↗

Write contents of std::string to a file. * @return true on success. */

Source from the content-addressed store, hash-verified

390 * @return true on success.
391 */
392static bool WriteBinaryFile(const fs::path &filename, const std::string &data)
393{
394 FILE *f = fsbridge::fopen(filename, "wb");
395 if (f == nullptr)
396 return false;
397 if (fwrite(data.data(), 1, data.size(), f) != data.size()) {
398 fclose(f);
399 return false;
400 }
401 fclose(f);
402 return true;
403}
404
405/****** Bitcoin specific TorController implementation ********/
406

Callers 1

add_onion_cbMethod · 0.85

Calls 3

fopenFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected