Click here to Skip to main content
15,884,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i compiled a LITTLEFS file system code for esp32. But the compilation was not successful. It generate the following error
error: no matching function for call to 'LITTLEFSImpl::open(const char*&, const char [2])'
     File f = open(path, "r");
                            ^


What I have tried:

This is the following code that i compiled
#include <Arduino.h>
#include "FS.h"
#include <LITTLEFS.h>

#define FORMAT_LITTLEFS_IF_FAILED true

void setup(){
  
}
void loop(){
  
}
Posted
Updated 13-May-22 23:30pm
v2

If you look at the GitHub source: Arduino/LittleFS.cpp at master · esp8266/Arduino · GitHub[^]
You will see that there are only one signature declared for LITTLEFSImpl::open
FileImplPtr LittleFSImpl::open(const char* path, OpenMode openMode, AccessMode accessMode) {
That requires three parameters, not two.
 
Share this answer
 
The open function does not take a string as the second parameter, it takes a bit mask of the OpenMode constants. See _open, _wopen | Microsoft Docs[^] for the values defined in Microsoft's stdio.h.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900