Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FS.h"
- //---------------------
- void setup()
- {
- Serial.begin(115200);
- Serial.println("");
- Serial.println("Abrindo arquivos");
- SPIFFS.begin();
- //SPIFFS.format();
- Dir dir = SPIFFS.openDir("/");
- while (dir.next())
- {
- Serial.print(dir.fileName());
- File f = dir.openFile("r");
- Serial.print(" size: ");
- Serial.println(f.size());
- }
- Serial.println(" ");
- //SPIFFS.remove("/f.txt");
- //SPIFFS.remove("/g.txt");
- delay(1500);
- File file2 = SPIFFS.open("/mesh.json","r");
- if (!file2) {
- Serial.println("Failed to open file for reading");
- return;
- }
- Serial.println("File Content:");
- while (file2.available()) {
- Serial.write(file2.read());
- }
- file2.close();
- }
- //---------------------
- void loop()
- {
- // Dir dir = SPIFFS.openDir("/");
- // while (dir.next())
- // {
- // Serial.print(dir.fileName());
- // File f = dir.openFile("r");
- // Serial.print(" size: ");
- // Serial.println(f.size());
- // }
- // Serial.println(" ");
- // //SPIFFS.remove("/f.txt");
- // //SPIFFS.remove("/g.txt");
- // delay(1500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement