open and Files information do not comply with Posix specifications

ESPfri2
Posts: 9
Joined: Tue May 07, 2019 3:52 pm

open and Files information do not comply with Posix specifications

Postby ESPfri2 » Wed May 08, 2019 1:59 pm

Hello,

this is the rework of my previous post "Incorrect File object information after file creation on a SD card and on SPIFFS"

I extended the investigation and modified the test program that lead me to conclude that the implementation of the Arduino ESP32 file manipulation do not comply with Posix specifications. As I was not able to find any documentation related to File for Arduino ESP32, I am supposing that Posix could be a good model.
The fact that the SD and SPIFFS implementation are different in behaviors tend also to prove that the implementations are incorrect.
The suppression of the truncate function do not help to my humble opinion, that's also the reason why I went to do this investigation ==> how to empty a file.

I have started to look at the Arduino ESP32 code, but obviously, I am not knowledgeable enough to correct that.
You will find at the end of this thread the new test program as well as the results I got.

:?: Does somebody knows to who should I send this information to get it challenged ? :?:

Thanks for your reading.

==================== old post =========================================

Just after creating a File on a SD card, the values returned by size() and available() are incorrect to me, they should be zero.
After a first write everything is back to normal, as you can see in the output below.

Is it a potential bug in the ESP32 package ?
for information, the same code running on a ESP8266 return zero.

thanks for your help.

Code: Select all

#include <Arduino.h>
#include <SPI.h>
#include <SD.h>

File MFile;

void setup() {
  
  Serial.begin(9600);
  delay(3000);
  while (!Serial) {}

  Serial.println("Initializing SD card");
  if (!SD.begin(5)) {
    Serial.println("... initialization failed");
    return;
  }
  Serial.println("initialization done");

  SD.remove("/f3.txt");

  MFile = SD.open("/f3.txt", "w+");

  if (!MFile)
   return;

  Serial.println("Just after open");
  Serial.print("Size           : "); Serial.println(MFile.size());
  Serial.print("Position       : "); Serial.println(MFile.position());
  Serial.print("Available data : "); Serial.println(MFile.available());

  MFile.println("nothing");
  MFile.flush();

  Serial.println("After the first write");
  Serial.print("Size           : "); Serial.println(MFile.size());
  Serial.print("Position       : "); Serial.println(MFile.position());
  Serial.print("Available data : "); Serial.println(MFile.available());
  
}

void loop() {

}
Output :
  • Initializing SD card
    initialization done
    Just after open
    Size : 4278124286
    Position : 0
    Available data : -16843010
    After the first write
    Size : 9
    Position : 9
    Available data : 0
Last edited by ESPfri2 on Fri May 17, 2019 8:02 am, edited 3 times in total.

ESPfri2
Posts: 9
Joined: Tue May 07, 2019 3:52 pm

Re: Incorrect File object informations after file creation on a SD card and on SPIFFS

Postby ESPfri2 » Fri May 10, 2019 12:30 pm

I extended the previous program to also tests SPIFFS and various file modes,
the results are badly impressive ... :o :shock:

To me there are clearly bugs, for example on SPIFFS, opening a non existing file in read mode will return a File object, when it clearly should not !
If a specialist of this can help me it would be great.

Code: Select all

#include <Arduino.h>
#include <SPIFFS.h>
#include <SPI.h>
#include <FS.h>
#include <SD.h>
#include <errno.h>

enum fstype {IsSD, IsSPIFFS};
char *fsname[] = {"SD card", "SPIFFS"};
char *NoYes[] = {"no", "yes"};
char c15[] = "0123456789ABCDF";
char CFilename[] = "/Test.txt";
File CFile;

void CreateFile(int FS, char *Mode) {

  Serial.println(">>>>>>>>>>>>>>>>>>");
  Serial.print  ("File on : ");Serial.println(fsname[FS]);
  Serial.println("  >> creation");
  Serial.print  ("     Mode : "); Serial.println(Mode);

  Serial.print  ("     Was existing     : ");
  if (FS == IsSD) {
    Serial.println(NoYes[SD.exists(CFilename)]);
    if (SD.exists(CFilename)) SD.remove(CFilename);
    CFile = SD.open(CFilename, Mode);
  } else {
    Serial.println(NoYes[SPIFFS.exists(CFilename)]);
    if (SPIFFS.exists(CFilename)) SPIFFS.remove(CFilename);
    CFile = SPIFFS.open(CFilename, Mode);
  }
  
  Serial.print("     Had been created : ");
  if (FS == IsSD) {
    Serial.println(NoYes[SD.exists(CFilename)]);
  } else {
    Serial.println(NoYes[SPIFFS.exists(CFilename)]);
  }

  Serial.print("  << result is : ");
  if (!CFile) {
    if (!strcmp("r", Mode))
      Serial.println("OK (File == 0)");
    else
      Serial.println("NOK !!!!!");
    return;
  } else {
    if (!strcmp("r", Mode)) {
      Serial.println("NOK !!!!! (File != 0)");
      return;
    } else
      Serial.println("OK"); 
  }

  if (!strcmp("r", Mode))
    if (!CFile)


  Serial.println("  >> Just after open");
  Serial.print("     Size           : "); Serial.println(CFile.size(), HEX);
  Serial.print("     Position       : "); Serial.println(CFile.position(), HEX);
  Serial.print("     Available data : "); Serial.println(CFile.available(), HEX);

  Serial.print("  << result is : ");
  if (CFile.size()==0 && CFile.position()==0 && CFile.available()==0)
    Serial.println("OK");
  else
    Serial.println("NOK !!!!!");

  CFile.write((const uint8_t*)c15, strlen(c15));
  CFile.flush();

  Serial.println("  >> After the first write");
  Serial.print("     Size           : "); Serial.println(CFile.size());
  Serial.print("     Position       : "); Serial.println(CFile.position());
  Serial.print("     Available data : "); Serial.println(CFile.available());

  Serial.print("  << result is : ");
  if (CFile.size()==strlen(c15) && CFile.position()==strlen(c15) && CFile.available()==0)
    Serial.println("OK");
  else
    Serial.println("NOK !!!!!");

  CFile.close();
}


void setup() {
  
  Serial.begin(9600);
  while (!Serial) {}
  Serial.println("Initializing ...");
  delay(3000);
  
  Serial.println("Initializing SPIFF");
  if(!SPIFFS.begin(true)){
      Serial.println("Error mounting SPIFFS");
  }

  Serial.println("Initializing SD card");
  if (!SD.begin(5)) {
    Serial.println("Error mounting SD card");
  }
  Serial.println("Initializations done");

  CreateFile(IsSD, "r");
  CreateFile(IsSD, "a");
  CreateFile(IsSD, "w");

  CreateFile(IsSPIFFS, "r");
  CreateFile(IsSPIFFS, "a");
  CreateFile(IsSPIFFS, "w");  

}

void loop() {

}
Here are the Raw results

Code: Select all

Initializing ...
Initializing SPIFF
Initializing SD card
Initializations done
>>>>>>>>>>>>>>>>>>
File on : SD card
  >> creation
     Mode : r
     Was existing     : yes
[E][vfs_api.cpp:64] open(): /sd/Test.txt does not exist
no
  << result is : OK (File == 0)
>>>>>>>>>>>>>>>>>>
File on : SD card
  >> creation
     Mode : a
     Was existing     : no
     Had been created : yes
  << result is : OK
    Size           : FEFEFEFE
    Position       : 0
    Available data : FEFEFEFE
  << result is : NOK !!!!!
  >> After the first write
    Size           : 15
    Position       : 15
    Available data : 0
  << result is : OK
>>>>>>>>>>>>>>>>>>
File on : SD card
  >> creation
     Mode : w
     Was existing     : yes
     Had been created : yes
  << result is : OK
    Size           : F
    Position       : 0
    Available data : F
  << result is : NOK !!!!!
  >> After the first write
    Size           : 15
    Position       : 15
    Available data : 0
  << result is : OK
>>>>>>>>>>>>>>>>>>
File on : SPIFFS
  >> creation
     Mode : r
     Was existing     : yes
     Had been created : no
  << result is : NOK !!!!! (File != 0)
>>>>>>>>>>>>>>>>>>
File on : SPIFFS
  >> creation
     Mode : a
     Was existing     : no
     Had been created : yes
  << result is : OK
    Size           : 3FFB20F4
    Position       : 0
    Available data : 3FFB20F4
  << result is : NOK !!!!!
  >> After the first write
    Size           : 0
    Position       : 15
    Available data : -15
  << result is : NOK !!!!!
>>>>>>>>>>>>>>>>>>
File on : SPIFFS
  >> creation
     Mode : w
     Was existing     : yes
     Had been created : yes
  << result is : OK
    Size           : 3FFB9978
    Position       : 0
    Available data : 3FFB9978
  << result is : NOK !!!!!
  >> After the first write
    Size           : 0
    Position       : 15
    Available data : -15
  << result is : NOK !!!!!


ESPfri2
Posts: 9
Joined: Tue May 07, 2019 3:52 pm

Re: Incorrect File object informations after file creation on a SD card and on SPIFFS

Postby ESPfri2 » Mon May 13, 2019 1:55 pm

summary

Code: Select all

Initializing SPIFF
Initializing SD card
Initializations done
Support  Mode     Open         Size Position  Available     Size Position  Available
SD card  r        OK            
SD card  a        OK            NOK       OK        NOK       OK       OK         OK
SD card  w        OK            NOK       OK        NOK       OK       OK         OK
SPIFFS   r        NOK            
SPIFFS   a        OK            NOK       OK        NOK      NOK       OK        NOK
SPIFFS   w        OK            NOK       OK        NOK      NOK       OK        NOK

Results :
Support  Mode     Open         Size Position  Available     Size Position  Available
SD card  r        0               
SD card  a        1               0        0          0        f        f          0
SD card  w        1               f        0         15        f        f          0
SPIFFS   r        1               
SPIFFS   a        1        3ffb9978        0 1073453432        0        f        -15
SPIFFS   w        1        3ffb9978        0 1073453432        0        f        -15

Expected :
Support  Mode     Open         Size Position  Available     Size Position  Available
SD card  r        0               
SD card  a        1               0        0          0        f        f          0
SD card  w        1               0        0          0        f        f          0
SPIFFS   r        0              
SPIFFS   a        1               0        0          0        f        f          0
SPIFFS   w        1               0        0          0        f        f          0

ESPfri2
Posts: 9
Joined: Tue May 07, 2019 3:52 pm

Re: open and Files information do not complying with Posix specifications

Postby ESPfri2 » Fri May 17, 2019 7:59 am

New results :

Code: Select all

Initializing ...
Initializing SD card
Initializing SPIFF
Initializations done
----
Running tests with a non existing file on :
   SD card :  r a w r+ a+ w+
   SPIFFS :  r a w r+ a+ w+
Running tests with a existing empty file on :
   SD card :  r a w r+ a+ w+
   SPIFFS :  r a w r+ a+ w+
Running tests with a existing non empty file on :
   SD card :  r a w r+ a+ w+
   SPIFFS :  r a w r+ a+ w+
----
-----------
With a file non existing
                           Just after open            After first write    
Support Mode Open     Size Position  Available     Size Position  Available
Posix   r       0        0        0          0        0        0          0
Posix   a       1        0        0          0        f        f          0
Posix   w       1        0        0          0        f        f          0
Posix   r+      0        0        0          0        0        0          0
Posix   a+      1        0        0          0        f        f          0
Posix   w+      1        0        0          0        f        f          0
SD card r       0        0        0          0        0        0          0
SD card a       1 3ffb9978        0 1073453432        f        f          0
SD card w       1        f        0         15        f        f          0
SD card r+      0        0        0          0        0        0          0
SD card a+      1        f        0         15        f        f          0
SD card w+      1        f        0         15        f        f          0
SPIFFS  r       1        0        0          0        0        0          0
SPIFFS  a       1        f        0         15        0        f        -15
SPIFFS  w       1        f        0         15        0        f        -15
SPIFFS  r+      1        f        0         15        f        f          0
SPIFFS  a+      1        f        f          0        f       1e        -15
SPIFFS  w+      1       1e        0         30        0        f        -15
-----------
With a file existing empty
                           Just after open            After first write    
Support Mode Open     Size Position  Available     Size Position  Available
Posix   r       1        0        0          0        0        0          0
Posix   a       1        0        0          0        f        f          0
Posix   w       1        0        0          0        f        f          0
Posix   r+      1        0        0          0        f        f          0
Posix   a+      1        0        0          0        f        f          0
Posix   w+      1        0        0          0        f        f          0
SD card r       1        0        0          0        0        0          0
SD card a       1        0        0          0        f        f          0
SD card w       1        0        0          0        f        f          0
SD card r+      1        0        0          0        f        f          0
SD card a+      1        0        0          0        f        f          0
SD card w+      1        0        0          0        f        f          0
SPIFFS  r       1        0        0          0        0        0          0
SPIFFS  a       1        0        0          0        0        f        -15
SPIFFS  w       1        0        0          0        0        f        -15
SPIFFS  r+      1        0        0          0        0        f        -15
SPIFFS  a+      1        0        0          0        0        f        -15
SPIFFS  w+      1        0        0          0        0        f        -15
-----------
With a file existing non empty
                           Just after open            After first write    
Support Mode Open     Size Position  Available     Size Position  Available
Posix   r       1        f        0         15        f        f          0
Posix   a       1        f        f          0       1e       1e          0
Posix   w       1        0        0          0        f        f          0
Posix   r+      1        f        f          0       1e       1e          0
Posix   a+      1        f        f         15       1e       1e          0
Posix   w+      1        0        0          0        f        f          0
SD card r       1        f        0         15        f        0         15
SD card a       1        f        f          0       1e       1e          0
SD card w       1        f        0         15        f        f          0
SD card r+      1        f        0         15        f        f          0
SD card a+      1        f        f          0       1e       1e          0
SD card w+      1        f        0         15        f        f          0
SPIFFS  r       1        f        0         15        f        0         15
SPIFFS  a       1        f        f          0        f       1e        -15
SPIFFS  w       1        f        0         15        0        f        -15
SPIFFS  r+      1        f        0         15        f        f          0
SPIFFS  a+      1        f        f          0        f       1e        -15
SPIFFS  w+      1        f        0         15        0        f        -15
new test

Code: Select all

#include <FS.h>
#include <SD.h>
#include <errno.h>

/*----------------------------------------------------------------
 * source : http://man7.org/linux/man-pages/man3/fopen.3.html
 
       r      Open text file for reading.  The stream is positioned at the
              beginning of the file.

       r+     Open for reading and writing.  The stream is positioned at the
              beginning of the file.

       w      Truncate file to zero length or create text file for writing.
              The stream is positioned at the beginning of the file.

       w+     Open for reading and writing.  The file is created if it does
              not exist, otherwise it is truncated.  The stream is
              positioned at the beginning of the file.

       a      Open for appending (writing at end of file).  The file is
              created if it does not exist.  The stream is positioned at the
              end of the file.

       a+     Open for reading and appending (writing at end of file).  The
              file is created if it does not exist.  Output is always
              appended to the end of the file.  POSIX is silent on what the
              initial read position is when using this mode.  For glibc, the
              initial file position for reading is at the beginning of the
              file, but for Android/BSD/MacOS, the initial file position for
              reading is at the end of the file.

from : https://pubs.opengroup.org/onlinepubs/009695399/functions/fopen.html           
r or rb
    Open file for reading.
w or wb
    Truncate to zero length or create file for writing.
a or ab
    Append; open or create file for writing at end-of-file.
r+ or rb+ or r+b
    Open file for update (reading and writing).
w+ or wb+ or w+b
    Truncate to zero length or create file for update.
a+ or ab+ or a+b
    Append; open or create file for update, writing at end-of-file. 
*/

//----------------------------------------------------------------
#define _BUFFERMAX 128
static char _Buffer[_BUFFERMAX]="";
void sprintln ( const char * format, ... )
{
  va_list args;
  va_start (args, format);
  vsnprintf (_Buffer, _BUFFERMAX, format, (va_list)args);
  Serial.println (_Buffer);
  va_end (args);
}
void sprint ( const char * format, ... )
{
  va_list args;
  va_start (args, format);
  vsnprintf (_Buffer, _BUFFERMAX, format, (va_list)args);
  Serial.print (_Buffer);
  va_end (args);
}


enum testtype {NEF, EEF, ENF};
char *testname[] = {"non existing", "existing empty", "existing non empty", NULL};

enum fstype {IsSD, IsSPIFFS};
int fsmounted[] = { 0, 0};
char *fsname[] = {"SD card", "SPIFFS", NULL};

char *NoYes[] = {"no", "yes"};
char *RES[] = {"OK", "NOK"};
char c15[] = "0123456789ABCDF";
char CFilename[] = "/TesT.txt";

struct Res_t {
  int open;
  size_t siz;
  size_t pos;
  int ava;
  size_t sizw;
  size_t posw;
  int avaw;
} *Rest;

#define L strlen(c15)
#define D 2*strlen(c15)

struct Test_t {
  const char *Mode;
  struct Res_t Exp[3];    // [NEF, EEF, ENF]
  struct Res_t Res[2][3]; // [SD, SPIFFS][NEF, EEF, ENF]
} Tests[] = {
  //       O S P A S P A
  {"r",  {{0,0,0,0,0,0,0},
          {1,0,0,0,0,0,0},
          {1,L,0,L,L,L,0}}},
  {"a",  {{1,0,0,0,L,L,0},
          {1,0,0,0,L,L,0},
          {1,L,L,0,D,D,0}}},
  {"w",  {{1,0,0,0,L,L,0},
          {1,0,0,0,L,L,0},
          {1,0,0,0,L,L,0}}},
  {"r+", {{0,0,0,0,0,0,0},
          {1,0,0,0,L,L,0},
          {1,L,L,0,D,D,0}}},
  {"a+", {{1,0,0,0,L,L,0},
          {1,0,0,0,L,L,0},
          {1,L,L,L,D,D,0}}},
  {"w+", {{1,0,0,0,L,L,0},
          {1,0,0,0,L,L,0},
          {1,0,0,0,L,L,0}}},
  {NULL}
};

File CFile;

//===========================================================
void RunTest(int FST, int Test, int Mode) { 

  struct Res_t *Res;

  
  // if file exist erase it
  if (FST == IsSD)
    if (SD.exists(CFilename)) SD.remove(CFilename);
  else
    if (SPIFFS.exists(CFilename)) SPIFFS.remove(CFilename);

  // if file should exist create it
  if ( Test == EEF || Test == ENF ) {
    if (FST == IsSD)
      CFile = SD.open(CFilename, "w");
    else
      CFile = SPIFFS.open(CFilename, "w");

    // if file should not be empty
    if ( Test == ENF)
      CFile.write((const uint8_t*)c15, L);

    CFile.flush();
    CFile.close();
  }

  if (FST == IsSD)
    CFile = SD.open(CFilename, Tests[Mode].Mode);
  else
    CFile = SPIFFS.open(CFilename, Tests[Mode].Mode);

  Res = &Tests[Mode].Res[FST][Test];

  Res->open = CFile;
  if (!Res->open)
    return;
    
  Res->siz = CFile.size();
  Res->pos = CFile.position();
  Res->ava = CFile.available();
  
  CFile.write((const uint8_t*)c15, L);
  CFile.flush();

  Res->sizw = CFile.size();
  Res->posw = CFile.position();
  Res->avaw = CFile.available();

  CFile.close();
}

void setup() {
  
  Serial.begin(9600);
  while (!Serial) {}
  Serial.println("Initializing ...");
  
  delay(3000);

  Serial.println("Initializing SD card");
  if (!SD.begin(5)) {
    Serial.print("Error mounting SD card");
    Serial.println(strerror(errno));
  } else
    fsmounted[IsSD] = 1;
  
  Serial.println("Initializing SPIFF");
  if(!SPIFFS.begin(true)){
      Serial.println("Error mounting SPIFFS");
  }else
    fsmounted[IsSPIFFS] = 1;

  Serial.println("Initializations done");

  sprintln("----");
  int t=0,f=0,m=0;
  while (testname[t]) {
    sprintln("Running tests with a %s file on :", testname[t]);
    f=0;
    while (fsname[f]) {
      sprint("   %s : ", fsname[f]);
      if (fsmounted[f]) {
        m=0;
        while(Tests[m].Mode) {
          sprint(" %s", Tests[m].Mode);
          RunTest(f, t, m); //Tests[m].Mode, &Tests[m].Res[f][t]);
          m++;
        }
        sprintln("");
      } else
        sprintln("not mounted");
      f++;
    }
    t++;
  }
  sprintln("----");
  t=0,f=0,m=0;
  while (testname[t]) {
    sprintln("-------------");
    sprintln("With a file : %s", testname[t]);
    f=0;
    sprintln("%-7s %-4s %4s %28s %28s", "", "", "", "Just after open    ", "After first write    ");
    sprintln("%-7s %-4s %4s %8s %8s %10s %8s %8s %10s", "Support", "Mode", "Open", "Size", "Position", "Available", "Size", "Position", "Available");
    m=0;
    while(Tests[m].Mode) {
      sprint("%-7s %-4s ", "Posix", Tests[m].Mode);
      Rest = &Tests[m].Exp[t];
      sprintln("%4x %8x %8x %10d %8x %8x %10d", Rest->open, Rest->siz, Rest->pos, Rest->ava, Rest->sizw, Rest->posw, Rest->avaw);
      m++;
    }
    while (fsname[f]) {
      if (fsmounted[f]) {
        m=0;
        while(Tests[m].Mode) {
          sprint("%-7s %-4s ", fsname[f], Tests[m].Mode);
          Rest = &Tests[m].Res[f][t];
          sprintln("%4x %8x %8x %10d %8x %8x %10d", Rest->open, Rest->siz, Rest->pos, Rest->ava, Rest->sizw, Rest->posw, Rest->avaw);
          m++;
        }
      } else
        sprintln("not mounted");
      f++;
    }
    t++;
  }


/*

      sprintln("%-8s %-8s %-8s %8s %8s %10s %8s %8s %10s", "Support", "Mode", "Open", "Size", "Position", "Available", "Size", "Position", "Available");
    while (ExNEF[i].Mode) {
      RunNEF(IsSD, ExNEF[i].Mode, &Tests[i]. );
      sprintln("%-8s %-8s %-8s %8s %8s %10s %8s %8s %10s", 
      fsname[Tests[i].FS], Tests[i].Mode, 
      (Tests[i].result.open == Tests[i].expect.open? RES[0] : RES[1]), 
      (Tests[i].result.siz == Tests[i].expect.siz? RES[0] : RES[1]), 
      (Tests[i].result.pos == Tests[i].expect.pos? RES[0] : RES[1]), 
      (Tests[i].result.ava == Tests[i].expect.ava? RES[0] : RES[1]),
      (Tests[i].result.sizw == Tests[i].expect.sizw? RES[0] : RES[1]), 
      (Tests[i].result.posw == Tests[i].expect.posw? RES[0] : RES[1]), 
      (Tests[i].result.avaw == Tests[i].expect.avaw? RES[0] : RES[1]));

  Serial.println("Raw results :");
  i=0;
  sprintln("%-8s %-8s %-8s %8s %8s %10s %8s %8s %10s", "Support", "Mode", "Open", "Size", "Position", "Available", "Size", "Position", "Available");
  while (Tests[i].Mode) {
    CreateFile(&Tests[i]);
    sprintln("%-8s %-8s %-8x %8x %8x %10d %8x %8x %10d", 
      fsname[Tests[i].FS], Tests[i].Mode, 
      Tests[i].result.open, 
      Tests[i].result.siz, Tests[i].result.pos, Tests[i].result.ava,
      Tests[i].result.sizw, Tests[i].result.posw, Tests[i].result.avaw);
      i++;
  }


  Serial.println("Expected results :");
  i=0;
  sprintln("%-8s %-8s %-8s %8s %8s %10s %8s %8s %10s", "Support", "Mode", "Open", "Size", "Position", "Available", "Size", "Position", "Available");
  while (Tests[i].Mode) {
    CreateFile(&Tests[i]);
    sprintln("%-8s %-8s %-8x %8x %8x %10d %8x %8x %10d", 
      fsname[Tests[i].FS], Tests[i].Mode, 
      Tests[i].expect.open, 
      Tests[i].expect.siz, Tests[i].expect.pos, Tests[i].expect.ava,
      Tests[i].expect.sizw, Tests[i].expect.posw, Tests[i].expect.avaw);
    i++;
  }

  Serial.println("----------------------------------------------");
  Serial.println("Work with a pre-existing empty file on the FS :");
  Serial.println("----------------------------------------------");
  Serial.println("Raw results :");
  i=0;
  sprintln("%-8s %-8s %-8s %8s %8s %10s %8s %8s %10s", "Support", "Mode", "Open", "Size", "Position", "Available", "Size", "Position", "Available");
  while (ETests[i].Mode) {
    ExistingFile(&ETests[i]);
    sprintln("%-8s %-8s %-8x %8x %8x %10d %8x %8x %10d", 
      fsname[ETests[i].FS], ETests[i].Mode, 
      ETests[i].result.open, 
      ETests[i].result.siz, ETests[i].result.pos, ETests[i].result.ava,
      ETests[i].result.sizw, ETests[i].result.posw, ETests[i].result.avaw);
      i++;
  }

  Serial.println("--------------------------------------------------");
  Serial.println("Work with a pre-existing non-empty file on the FS :");
  Serial.println("--------------------------------------------------");
  Serial.println("Raw results :");
  i=0;
  sprintln("%-8s %-8s %-8s %8s %8s %10s %8s %8s %10s", "Support", "Mode", "Open", "Size", "Position", "Available", "Size", "Position", "Available");
  while (EnTests[i].Mode) {
    ExistingNeFile(&EnTests[i]);
    sprintln("%-8s %-8s %-8x %8x %8x %10d %8x %8x %10d", 
      fsname[EnTests[i].FS], EnTests[i].Mode, 
      EnTests[i].result.open, 
      EnTests[i].result.siz, EnTests[i].result.pos, EnTests[i].result.ava,
      EnTests[i].result.sizw, EnTests[i].result.posw, EnTests[i].result.avaw);
      i++;
  }
*/
}

void loop() {

}

muller59
Posts: 3
Joined: Thu Jul 18, 2019 11:59 am

Re: open and Files information do not comply with Posix specifications

Postby muller59 » Thu Jul 18, 2019 12:03 pm

After hitting the brick wall one too many times, i googled my problem and found this post.
i also found another post on github that related to this.
I thought you would be interested in the answer from the developer of esp32 SPIFFS

https://github.com/espressif/arduino-esp32/issues/681

regards,

Rob

ESPfri2
Posts: 9
Joined: Tue May 07, 2019 3:52 pm

Re: open and Files information do not comply with Posix specifications

Postby ESPfri2 » Thu Jul 18, 2019 3:04 pm

thanks !
I will look at it

Who is online

Users browsing this forum: Federico66 and 11 guests