File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -46,21 +46,17 @@ boolean cmdNameInit() { // seach op SPIFFS the names of the commands
4646
4747void deleteFileLike (const char * path) { // path does not start with "/")
4848 const char * pchar;
49- Serial.print (" path=" ); Serial.println (path);
5049 File root = SPIFFS.open (" /" );
5150 if (!root){
5251 fillMsg (__SPIFFS_FAIL_TO_OPEN );
53- Serial.println (" fail to open SPIFFS" );
5452 root.close () ;
5553 return ;
5654 }
5755 File file = root.openNextFile ();
5856 while (file){
59- pchar = file.name () ;
60- Serial.print (" fileName=" );Serial.println (pchar);
57+ pchar = file.name () ; // filename from SPIFFS starts with "/" so it is different from path
6158 if (pchar[1 ] == ' C' && pchar[2 ] == ' m' && pchar[3 ] == ' d' && pchar[4 ] == path[3 ] && pchar[5 ] == ' _' ) {
6259 SPIFFS.remove (pchar ); // delete file having a name that begins with Cmdx_ (with same x)
63- Serial.println (" remove 1 file" );
6460 }
6561 file = root.openNextFile ();
6662 }
You can’t perform that action at this time.
0 commit comments