martinayotte wrote:Code: Select all....
File f = SPIFFS.open("/Tourlou.txt", "a");
if (!f) {
Serial.println("Can't open Tourlou.txt !\r\n");
}
else {
String str = "Il etait une fois ...\r\n";
f.write((uint8_t *)str.c_str(), str.length());
f.close();
}
File f = SPIFFS.open("/Tourlou.txt", "r"); <---------------------------
......
}
Here I get a redeclaration on compiling. IMHO only f = SPIFFS.open("/Tourlou.txt", "r");
But a good code-example to understand SPIFFS
Edit:
Is it really possible to make different directories?
For testing, I changed :
Dir dir = SPIFFS.openDir("/data");
-->
Dir dir = SPIFFS.openDir("/data2");
Edit_2:
Does anybody get the file.seek function running?
With
f.seek(3, SeekSet);
SPIFFS_1:43: error: 'SeekSet' was not declared in this scope
SeekCur and SeekEnd does not better
ESP8266 Arduino add-on
Arduino IDE 1.6.5