LittleFS difference between starting with dir.next() and dir.rewind()

----------------------------- Delete below -----------------------------

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-12
  • Core Version: 2.6.3
  • Development Env: Arduino IDE
  • Operating System: Windows10

Settings in IDE

  • Module: Wemos D1 R2
  • Flash Mode: ?
  • Flash Size: 4MB
  • lwip Variant: ?
  • Reset Method: ?
  • Flash Frequency: ?
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 115200

Problem Description

The iteration after a dir.next() starts with the third entry of the directory.
The entrys with the name . (dot) and .. (dot dot) are skipped.
After a dir.rewind() these entries will be included.
In the current PIFFS version, the first two entries are skipped in BOTH versions.

MCVE Sketch

//To test by adding in example LittleFS_Timestamp in the listDir() function at the end:

Serial.println ("REWIND");
  root.rewind ();
  while (root.next ()) {
    File file = root.openFile ("r");
    Serial.print ("FILE:");
    Serial.print (root.fileName ());
    Serial.print ("SIZE:");
    Serial.println (file.size ());
  }

//(the SPIFFS version can also be tested with this option)