lorol / LITTLEFS

LittleFS library for arduino-esp32
GNU General Public License v2.0
166 stars 68 forks source link

LITTLEFSimpl::exists() bug with Platformio (ESP32 arduino framework) in Visual Studio Code #43

Open har-in-air opened 2 years ago

har-in-air commented 2 years ago
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 third argument File f = open(path, "r", false);

goblingift commented 2 years ago

@tonyrewin - thanks for your bugfix. When will this gets released?

Michael2MacDonald commented 2 years ago

Screw it. I am going to submit a fix today if possible.

Michael2MacDonald commented 2 years ago

For some reason, I can't get the PR I created to show up here. If someone could help teach me how to do that or why it is not working then that would be great.

But my PR can be found here: https://github.com/lorol/LITTLEFS/pull/56

Please review and merge my PR so this tiny issue can finally be over!

EDIT: I got trigger happy and just realized that PR https://github.com/lorol/LITTLEFS/pull/49 exists! Please merge one of these, or make the fix manually, and then close all the PRs and this issue!

waymond91 commented 1 year ago

Im still running into this using platformio. Am I installing the wrong version?

eatonJ commented 1 year ago

FYI ... I had this issue today and used this fix to correct the error . Thanks

sommerper commented 1 year ago

@eatonJ How did you fix it? I'm still getting the error when importing to PlatformIO. :-/ Latest release seems to be lorol/LittleFS_esp32@^1.0.6.

zhaocundang commented 1 year ago

yes, 2023 5-1 still error

dharms87 commented 1 year ago

Tried to implement this library in a PlatformIO project. Received similar error messages posted above.

However, I noticed this message in the output when compiling: LittleFS_esp32/src/esp_littlefs.c:19:2: warning: #warning ("Use the built-in LITTLEFS library") [-Wcpp]

warning("Use the built-in LITTLEFS library")

After reviewing the "Built-In" portion of the supported libraries within PlatformIO. I noticed that LittleFS is built into the framework-arduinoespressif32.

My project compiled successfully after doing the following in my main.cpp file:

include

Then add the following in the platformio.ini file, under the lib_deps = LittleFS @ ^2.0.0

gatti-d commented 1 year ago

Received similar error messages posted above. The solution proposed by #dharms87 worked as well. Thank you!

urs8000 commented 11 months ago

still had the error compiling LITTLEFS_test.ino under Arduino 1.8.19 corrected as in first comment with ... in LITTLEFS.cpp bool LITTLEFSImpl::exists(const char* path) { File f = open(path, "r", false); return (f == true); }

Michael2MacDonald commented 7 months ago

I have a PR located here (https://github.com/lorol/LITTLEFS/pull/56). It has been approved but no action has been taken to merge it for some reason.