Skip to content

Conversation

@Michael2MacDonald
Copy link

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 Michael2MacDonald changed the title Fixed LITTLEFSimpl::exists() error: Closes #10 Fixed LITTLEFSimpl::exists() error: Closes #43 Sep 28, 2022
@Michael2MacDonald Michael2MacDonald changed the title Fixed LITTLEFSimpl::exists() error: Closes #43 Fixed LITTLEFSimpl::exists() error: Closes lorol/LITTLEFS#43 Sep 28, 2022
@Michael2MacDonald Michael2MacDonald changed the title Fixed LITTLEFSimpl::exists() error: Closes lorol/LITTLEFS#43 Fixed LITTLEFSimpl::exists() error: Fix lorol/LITTLEFS#43 Sep 28, 2022
hakuame added a commit to hakuame/LITTLEFS that referenced this pull request Jul 24, 2023
Fixed LITTLEFSimpl::exists() error: Fix lorol#43 lorol#56
@pauldotknopf
Copy link

What's the hold up here?

@Michael2MacDonald
Copy link
Author

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?

@palmarci
Copy link

palmarci commented Jul 7, 2024

This is still a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants