SPIFFS open file r+ - BUG?

On ESP8266(NodeMcu) I have follow snippet:

File flog;
    flog = SPIFFS.open(db_min_name, "r+"); ///works with a+, for r+ overwrites first line
    if (flog) {
      String out_text = "";
      out_text = logEvent.s1; //any float number
      out_text += ";";
      out_text += logEvent.s2; //any float number
      out_text += ";";
      out_text += logEvent.s3; //any float number

But when I open file with r+ it overwrites first line only, not add new one, with a+ it works properly.


This is expected and documented behaviour, so what is the question?



Problem is that with r+ I estimate open file for add new line on top of file, but it does not add but overwrites first line only. With a+ it as estimated add new line to bottom of file.

As I already told you that is one of the differences between r+ and a+.

If you don't want r+ why would you use it?

There is no bug in hammer and nails if you nail your foot to the floor.

If the behaviour and the documentation don't meet you expectations, then you have a bug in your expectations.