diff --git a/libraries/FS/src/vfs_api.cpp b/libraries/FS/src/vfs_api.cpp index 6502f760560..346b7a93248 100644 --- a/libraries/FS/src/vfs_api.cpp +++ b/libraries/FS/src/vfs_api.cpp @@ -184,6 +184,11 @@ bool VFSImpl::rmdir(const char *path) return false; } + if (strcmp(_mountpoint, "/spiffs") == 0) { + log_e("rmdir is unnecessary in SPIFFS"); + return false; + } + VFSFileImpl f(this, path, "r"); if(!f || !f.isDirectory()) { if(f) { @@ -200,7 +205,7 @@ bool VFSImpl::rmdir(const char *path) return false; } sprintf(temp,"%s%s", _mountpoint, path); - auto rc = unlink(temp); + auto rc = ::rmdir(temp); free(temp); return rc == 0; }