mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Don't use rmdir_r but roll our own version.
This commit is contained in:
@@ -28,6 +28,34 @@ void listDir(const char * dirname, uint8_t levels)
|
||||
#endif
|
||||
}
|
||||
|
||||
void rmDir(const char * dirname)
|
||||
#ifdef FSCom
|
||||
{
|
||||
File root = FSCom.open(dirname);
|
||||
if(!root){
|
||||
return;
|
||||
}
|
||||
if(!root.isDirectory()){
|
||||
return;
|
||||
}
|
||||
|
||||
File file = root.openNextFile();
|
||||
while(file){
|
||||
if(file.isDirectory() && !String(file.name()).endsWith(".")) {
|
||||
file.close();
|
||||
rmDir(file.name());
|
||||
FSCom.rmdir(file.name());
|
||||
} else {
|
||||
file.close();
|
||||
FSCom.remove(file.name());
|
||||
}
|
||||
file.close();
|
||||
file = root.openNextFile();
|
||||
}
|
||||
file.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
void fsInit()
|
||||
{
|
||||
#ifdef FSCom
|
||||
|
||||
Reference in New Issue
Block a user