8000 Fix to SPIFFS openDir() enumeration .. · Issue #1818 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content
Fix to SPIFFS openDir() enumeration .. #1818
Closed
@seclorum

Description

@seclorum

There is a bug in SPIFFS.

This simple tweak to SPIFFS:

EDIT: PR here #1819

DirImplPtr SPIFFSImpl::openDir(const char* path) {
    if (strlen(path) > 0) {
        if (!isSpiffsFilenameValid(path)) {
            DEBUGV("SPIFFSImpl::openDir: invalid path=`%s` \r\n", path);
            return DirImplPtr();
        }
    }

.. means that we can do this:

  POVDir = SPIFFS.openDir("");

.. and get the 'root' - i.e. all filenames in the SPIFFS

Note: without this code, there is no way to get files you put into SPIFFS that are not named with the prefix '/', for example .. which is not enforced anywhere else in SPIFFS, so you can in fact put files on SPIFFS that you can't retrieve, at the moment ..

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0