Skip to content

SPIFFS - Error trying to open an empty created file #1126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
platenyponchet opened this issue Dec 1, 2015 · 0 comments
Closed

SPIFFS - Error trying to open an empty created file #1126

platenyponchet opened this issue Dec 1, 2015 · 0 comments
Milestone

Comments

@platenyponchet
Copy link

Obs.: It's ok to open in read mode.
The code is here:

#include "FS.h"
//#include <ArduinoJson.h>

File f;

void setup() {
    Serial.begin(115200);
    Serial.println("");
    delay(1000);
    Serial.println("Mounting FS...");

    if (!SPIFFS.begin()) {
        Serial.println("Failed to mount file system");
        return;
    }

    SPIFFS.format();
    f = SPIFFS.open("/test.txt", "w");
    f.close();
    f = SPIFFS.open("/test.txt", "w");
    if(!f) Serial.print("Error.");
    else Serial.print("Ok."); 
    f.close();  
}

void loop() {

}
@igrr igrr added the type: bug label Dec 5, 2015
@igrr igrr added this to the 2.1.0 milestone Dec 5, 2015
@igrr igrr closed this as completed Feb 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants