user16684: Trying to list root directory of LittleFS; but only files beginging with "/LOG."
String str;

                     if (!LittleFS.begin())
                     {
                          Serial.println("LittleFS failed to mount !");
                     }
                     Dir dir = LittleFS.openDir("/");
                     while (dir.next())
                     {



                        if(strncmp(dir.fileName().c_str(), "/LOG", 4) == 0)
                        {

                            str += "<a href=\"";
                            str += dir.fileName();
                            str += "\">";
                            str += dir.fileName();
                            str += "</a>";
                            str += "    ";
                            str += dir.fileSize();
                            str += "<br>\r\n";
                        }
                     }

                     client.print(str);

If I comment out "if(strncmp(dir.fileName().c_str(), "/LOG", 4) == 0)" and associated braces; all files list.  Code with "if(strncmp(dir.fileName().c_str(), "/LOG", 4) == 0)" no files are listed.
How can I list only files that begin with "/LOG?"
William

user66535: Give a filename String to text...
String text = "/LOGsdfsdf";
if(text.startsWith("/LOG")){
//wee file begins with /LOG
}else{
// wops wrong file.
}

Look in here
https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/
Method url startsWith("");
https://www.arduino.cc/reference/en/language/variables/data-types/string/functions/startswith

16684: <p>Trying to list root directory of LittleFS; but only files beginging with "/LOG."</p>

<pre><code>String str;

                     if (!LittleFS.begin())
                     {
                          Serial.println("LittleFS failed to mount !");
                     }
                     Dir dir = LittleFS.openDir("/");
                     while (dir.next())
                     {



                        if(strncmp(dir.fileName().c_str(), "/LOG", 4) == 0)
                        {

                            str += "&lt;a href=\"";
                            str += dir.fileName();
                            str += "\"&gt;";
                            str += dir.fileName();
                            str += "&lt;/a&gt;";
                            str += "    ";
                            str += dir.fileSize();
                            str += "&lt;br&gt;\r\n";
                        }
                     }

                     client.print(str);
</code></pre>

<p>If I comment out "if(strncmp(dir.fileName().c_str(), "/LOG", 4) == 0)" and associated braces; all files list.  Code with "if(strncmp(dir.fileName().c_str(), "/LOG", 4) == 0)" no files are listed.</p>

<p>How can I list only files that begin with "/LOG?"</p>

<p>William</p>
 66535: <p>Give a filename String to text...</p>

<pre><code>String text = "/LOGsdfsdf";
if(text.startsWith("/LOG")){
//wee file begins with /LOG
}else{
// wops wrong file.
}
</code></pre>

<p>Look in here</p>

<p><a href="https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/" rel="nofollow noreferrer">https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/</a></p>

<p>Method url <code>startsWith("");</code></p>

<p><a href="https://www.arduino.cc/reference/en/language/variables/data-types/string/functions/startswith" rel="nofollow noreferrer">https://www.arduino.cc/reference/en/language/variables/data-types/string/functions/startswith</a></p>
