MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / write_file

Method write_file

core/src/utils/file.cc:81–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81bool file::write_file(const path &path, const void *buffer, size_t length)
82{
83#if OS_WIN
84 FILE *fp = _wfopen(path.c_str(), L"wb");
85#else
86 FILE *fp = fopen(path.c_str(), "wb");
87#endif
88
89 if (fp != nullptr)
90 {
91 fwrite(buffer, 1, length, fp);
92 fclose(fp);
93 return true;
94 }
95
96 return false;
97}
98
99std::vector<path> file::read_dir(const path &dir)
100{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected