MCPcopy Create free account
hub / github.com/brichard19/BitCrack / appendToFile

Function appendToFile

util/util.cpp:195–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193 }
194
195 bool appendToFile(const std::string &fileName, const std::string &s)
196 {
197 std::ofstream outFile;
198 bool newline = false;
199
200 if(getFileSize(fileName) > 0) {
201 newline = true;
202 }
203
204 outFile.open(fileName.c_str(), std::ios::app);
205
206 if(!outFile.is_open()) {
207 return false;
208 }
209
210 // Add newline following previous line
211 if(newline) {
212 outFile << std::endl;
213 }
214
215 outFile << s;
216
217 return true;
218 }
219
220 std::string format(const char *formatStr, double value)
221 {

Callers 1

resultCallbackFunction · 0.85

Calls 1

getFileSizeFunction · 0.85

Tested by

no test coverage detected