MCPcopy Create free account
hub / github.com/BruceDevices/firmware / appendToFS

Method appendToFS

src/core/mifare_keys_manager.cpp:276–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276bool MifareKeysManager::appendToFS(FS *fs, const char *fsName, const String &key) {
277 if (!fs->exists(KEYS_DIR)) { fs->mkdir(KEYS_DIR); }
278
279 if (!fs->exists(KEYS_PATH)) {
280 log_i("File missing on %s, creating", fsName);
281 // Need to create full file - will be done by caller
282 return false;
283 }
284
285 File file = fs->open(KEYS_PATH, FILE_APPEND);
286 if (!file) {
287 log_w("Failed to append to %s", fsName);
288 return false;
289 }
290
291 file.println(key);
292 file.close();
293 return true;
294}

Callers

nothing calls this directly

Calls 2

closeMethod · 0.80
printlnMethod · 0.45

Tested by

no test coverage detected