Skip to content
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

File append not working with SPIFFS #1012

Closed
michprev opened this issue Sep 18, 2017 · 7 comments
Closed

File append not working with SPIFFS #1012

michprev opened this issue Sep 18, 2017 · 7 comments

Comments

@michprev
Copy link

I am experiencing a problem when trying to open a file from SPIFFS storage in append mode using C standard file api. Read/write mode works with no problems.

@me-no-dev
Copy link
Member

can you please post some test code? I tested fopen(path, "a") and it worked as expected.

@michprev
Copy link
Author

sure, example code: https://github.com/michprev/flyhero-esp32/tree/224f8e446d2d7854198ae4b79348077e04d56ace/Logging

Also tried to use c++ ofstream class. In this case file was not created.

@nkolban
Copy link
Contributor

nkolban commented Sep 20, 2017

What is the exact nature of the problem? Is it that fopen() for append returns null? If so, what is the value of errno immediately after the fopen()?

@michprev
Copy link
Author

I get ENOENT (No such file or directory) right after fopen(). Running

file = fopen(path, "w");
fclose(file);

file = fopen(path, "a");

works as expected. It seems like file is not created (if not exists) with "a" option.

@me-no-dev
Copy link
Member

Issue found :) expect it to be resolved when changes are merged

@me-no-dev
Copy link
Member

@nkolban issue was that nonexistent file was not created when it's opened with append. I guess SPIFFS append worked in a different way ;) Fix will be in today or tomorrow :)

igrr pushed a commit that referenced this issue Sep 21, 2017
@igrr
Copy link
Member

igrr commented Sep 23, 2017

Fixed in 14b12a2.

@igrr igrr closed this as completed Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants