ports: 882b12c44e
This commit is contained in:
Me No Dev
2020-11-03 19:58:23 +02:00
committed by GitHub
parent 41e392f661
commit 9a9fb2c3aa

View File

@ -184,6 +184,11 @@ bool VFSImpl::rmdir(const char *path)
return false; return false;
} }
if (strcmp(_mountpoint, "/spiffs") == 0) {
log_e("rmdir is unnecessary in SPIFFS");
return false;
}
VFSFileImpl f(this, path, "r"); VFSFileImpl f(this, path, "r");
if(!f || !f.isDirectory()) { if(!f || !f.isDirectory()) {
if(f) { if(f) {
@ -200,7 +205,7 @@ bool VFSImpl::rmdir(const char *path)
return false; return false;
} }
sprintf(temp,"%s%s", _mountpoint, path); sprintf(temp,"%s%s", _mountpoint, path);
auto rc = unlink(temp); auto rc = ::rmdir(temp);
free(temp); free(temp);
return rc == 0; return rc == 0;
} }