I’m using the following code with Arduino IDE 2.0.0-beta.5 to generate code for an ESP8266 (added with this JSON):
File sdFile = SD.open(filename, FILE_APPEND);
and I got this error message:
c:\Users\myUser\Documents\Arduino\libraries\dogBoxLib\utility\helper.cpp:68:37: error: 'FILE_APPEND' was not declared in this scope File sdFile = SD.open(filename, FILE_APPEND);
The console also says this (I deleted all other Arduino IDE installations):
Using library SD at version 2.0.0 in folder: C:\Users\myUser\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\SD
The mentioned SD library has the following code in its SD.h file:
#undef FILE_READ #define FILE_READ sdfat::O_READ #undef FILE_WRITE #define FILE_WRITE (sdfat::O_READ | sdfat::O_WRITE | sdfat::O_CREAT | sdfat::O_APPEND)
Why can’t I use the FILE_APPEND constant in order to add new content at the end of the file instead of overwriting it? It’s the only error that prevents my code to be compiled.
Thanks and best regards!