Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void appendFile(fs::FS &fs, const char * path, const char * message) {
- //Serial.printf("Appending to file: %s\n", path);
- File file = fs.open(path, FILE_APPEND);
- if (!file) {
- Serial.println("Failed to open file for appending");
- return;
- }
- if (file.print(message)) {
- //Serial.println("Message appended");
- } else {
- Serial.println("Append failed");
- }
- file.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment