Skip to content

Can FS/src/vfs_api.cpp VFSImpl::rmdir use actual rmdir instead of or in addition to unlink? #4138

Closed
@lorol

Description

@lorol

Hardware:

Board: ESP32 Dev Module
Core Installation/update date: b92c58d 2020-05-31
IDE name: Arduino IDE
Flash Frequency: 40Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10

Description:

The sketch tests LittleFS, based on https://github.com/joltwallet/esp_littlefs
Proposed as: #4096 until the LittleFS gets implemented as official IDF-ESP component or otherwise.
Everything works except FS.rmdir(path) - which always fails
As found by @joltwallet, the implemented in esp_littlefs.c rmdir is not called, rather unlink is called from vfs_api.cpp
https://github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/vfs_api.cpp#L203

Sketch:

https://github.com/lorol/LITTLEFS/blob/master/examples/LittleFS_test/LittleFS_test.ino

Debug Messages:

Serial Output:

...
  FILE: /mydir/hello2.txt	SIZE: 6
Deleting file: /mydir/hello2.txt
- file deleted
Removing Dir: /mydir
rmdir failed
Listing directory: /
  DIR : /mydir
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions