LITTLEFS icon indicating copy to clipboard operation
LITTLEFS copied to clipboard

Fixed `LITTLEFSimpl::exists()` error: Fix lorol/LITTLEFS#43

Open Michael2MacDonald opened this issue 3 years ago • 3 comments

LitteFS fails to compile, resulting in this error:

Compiling .pio/build/esp32dev/lib63a/LittleFS_esp32/LITTLEFS.cpp.o
.pio/libdeps/esp32dev/LittleFS_esp32/src/LITTLEFS.cpp: In member function 'virtual bool LITTLEFSImpl::exists(const char*)':
.pio/libdeps/esp32dev/LittleFS_esp32/src/LITTLEFS.cpp:44:28: error: no matching function for call to 'LITTLEFSImpl::open(const char*&, const char [2])'
     File f = open(path, "r");
In file included from .pio/libdeps/esp32dev/LittleFS_esp32/src/LITTLEFS.cpp:17:
/home/hari/.platformio/packages/framework-arduinoespressif32/libraries/FS/src/vfs_api.h:38:17: note: candidate: 'virtual fs::FileImplPtr VFSImpl::open(const char*, const char*, bool)'
     FileImplPtr open(const char* path, const char* mode, const bool create) override;
                 ^~~~
/home/hari/.platformio/packages/framework-arduinoespressif32/libraries/FS/src/vfs_api.h:38:17: note:   candidate expects 3 arguments, 2 provided
*** [.pio/build/esp32dev/lib63a/LittleFS_esp32/LITTLEFS.cpp.o] Error 1

Fixed by adding a third argument to the call to the open function as shown below.

File f = open(path, "r");        // Current
File f = open(path, "r", false); // My Fix

This function call is located on line 44 of src/LITTLEFS.cpp:

bool LITTLEFSImpl::exists(const char* path)
{
    File f = open(path, "r", false);
    return (f == true);
}

Michael2MacDonald avatar Sep 28 '22 16:09 Michael2MacDonald

What's the hold up here?

pauldotknopf avatar Dec 02 '23 09:12 pauldotknopf

It looks like this was approved but no further action was taken to merge. It should be pretty simple to merge unless there is something blocking it. Can we get an update?

Michael2MacDonald avatar Feb 25 '24 23:02 Michael2MacDonald

This is still a problem

palmarci avatar Jul 07 '24 11:07 palmarci