From 9a9fb2c3aad54c182d1131c8fb48200af45368c3 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Tue, 3 Nov 2020 19:58:23 +0200 Subject: [PATCH] port 882b12c44e9aca640a8adad16c11cd41c67e0f7b over ports: https://github.com/espressif/arduino-esp32/commit/882b12c44e9aca640a8adad16c11cd41c67e0f7b --- libraries/FS/src/vfs_api.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/FS/src/vfs_api.cpp b/libraries/FS/src/vfs_api.cpp index 6502f760..346b7a93 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; }