-
Notifications
You must be signed in to change notification settings - Fork 7.6k
LittleFS.exists() is giving an error #7615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree. The message should be at info, debug, or verbose log level. However it's not that simple. exists() actually calls open() on the file (and then closes it) with read only permission, no create flag. In your case you are looking at a directory, so the solution is slightly different. Workaround: use |
I believe you that's not that simple :) But even as info or verbose, this is a wrong info: "XXX does not exist, no permits for creation". As I don't want create a file at this point of the code. Rewrite the Maybe with a new argument with Maybe opening the file with the |
I encountered this same issue, and instead of using their exists function I just use the normal sys/stat.h stat() function - it will return whether a file/directory exists or not, and won't print that error. This actually works for SD cards as well as a bonus. |
I have the same issue when i do a LittleFS.exist on an empty directory Code snippet example:
|
In my use case I avoid checking first with exists() and if yes, use open() to load it because of performance. I use always open() and check whether I got the file or not. My recommendation is to only show it in verbose mode. |
This is not an answer. The library MUST not log in that case. I have the same problem, and I'm using the com port. And technically:
Don't say that it's not that simple. It is ! Lazyness is not a solution ! And finally a workaround for this problem No log at all. |
All it dose is clog the log when calling VFSImpl::exists. Related to <espressif#7615>
…whether the file exists, because open() will log an error which is confusing, but might be relevant in case a developer uses open() and expects that the file is there. espressif#7615
Use exists() from VFSImpl base class and avoid using open() to check whether the file exists, because open() will log an error which is confusing, but might be relevant in case a developer uses open() and expects that the file is there. espressif#7615
Use exists() from VFSImpl base class and avoid using open() to check whether the file exists, because open() will log an error which is confusing, but might be relevant in case a developer uses open() and expects that the file is there. espressif#7615
All it dose is clog the log when calling VFSImpl::exists. Related to <espressif#7615>
All it dose is clog the log when calling VFSImpl::exists. Related to <espressif#7615>
All it dose is clog the log when calling VFSImpl::exists. Related to <espressif#7615>
All it dose is clog the log when calling VFSImpl::exists. Related to <espressif#7615>
Board
ESP32-S3
Device Description
ESP32-S3 16MB Dev-Kit
Hardware Configuration
Nothing
Version
v2.0.5
IDE Name
Arduino IDE 2.0.4
Operating System
Windows 10
Flash frequency
240MHz
PSRAM enabled
no
Upload speed
115200
Description
I am using the LittleFS library.
When I try to check if a file exists, this function is executed:
arduino-esp32/libraries/LittleFS/src/LittleFS.cpp
Line 46 in bb8c855
As it try to open a file, I get this error:
[E][vfs_api.cpp:104] open(): /littlefs/g00000/c001 does not exist, no permits for creation
From this line:
arduino-esp32/libraries/FS/src/vfs_api.cpp
Line 105 in bb8c855
I think this error should not be logged, if we just check if a file exists.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: