-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SDFS File::flush() appears to do nothing #1293
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
Comments
Or do I just see this behaviour mentioned here: #514 (comment) ? why should a file handle be closed if another one is opened for the same file? this is completely not to be expected, is it? |
I had the same issue. |
I confirm that File.flush() does not work as expected. For example instead of |
Same Problem with Flash (FFAT) File write. This works...but its to slow And this doesn't work... nothing is written I have to write 18 Bytes every 1ms. |
Just use the POSIX implementation : fopen, fwrite, fsync, fclose. |
|
I'm getting a |
@Bascy : the workaround has already been merged 5 days ago. I think it will land in the stable release sooner or later. fileno() is an internal function, you cannot use it in a sketch. |
I'm getting the compile error when compiling FS library through my script, not using #if 0 /*ndef STRICT_ANSI - FIXME: must initialize stdio first, use fn */ |
Solved, was caused by a stray compiler option |
For me. the error is caused by -std=c++17. But I wouldn't call that a stray compiler option. There are libraries that require this option. |
@ArosPrince If you are looking to use a newer standard from the one defined in the platform.txt you need to use the GNU extension variant. So the ESP32 Arduino project currently uses -std=gnu++11 if you wanted to use C++17 you change this to -std=gnu++17. Using a newer C++ standard should probably be raised as a separate issue. |
@davefiddes OK, thanks. Good to know. |
I have a long running process that regularly appends data to a file on SD card and calls flush() on it afterwards. Still when I open the very same file and read its content it has no data appended nor its file size updated. When I close the file between writes, the data is there though. The exact same code works as expected when the file lifes on SPIFFS. So I assume that SD flush() is either not implemented or is buggy.
The text was updated successfully, but these errors were encountered: