Post topics, source code that relate to the Arduino Platform

User avatar
By Inq720
#71253 BRIEF: SPIFFS can have 5 files open. On the 6th, SPIFFS.open() still returns a valid file handle. If I use available() or size() on the handle, I get zero. The problem is the code can't tell if the zero is because its the 6th file or the file is zero length. How can the code tell the difference?

DETAILS: My code is rather multi-threaded (all be it... co-operative multi-threaded) and its set up to return control to the Sketch.loop() and the next time through, if there is an available file spot, it can then open and process the file.

As work arounds, I could:
(1) Make a file counter and not let it get to 6. But then if I replace SPIFFS with something else, I'm having to revisit this web-server code.
(2) Write some code to make sure the end-users don't load some zero length files.

Both seem rather a kludge - Any suggestions?
User avatar
By Inq720
#71266 I apologize... I'm new working with the ESP8266 (which has been very pleasant) and I haven't quite ascertained the boundaries. I guess the File System documentation being under ESP8266 Arduino Core mislead me.