Guest User

Untitled

a guest
Mar 2nd, 2021
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void appendFile(fs::FS &fs, const char * path, const char * message) {
  2.   //Serial.printf("Appending to file: %s\n", path);
  3.   File file = fs.open(path, FILE_APPEND);
  4.   if (!file) {
  5.     Serial.println("Failed to open file for appending");
  6.     return;
  7.   }
  8.   if (file.print(message)) {
  9.     //Serial.println("Message appended");
  10.   } else {
  11.     Serial.println("Append failed");
  12.   }
  13.   file.close();
  14. }
RAW Paste Data