Skip to content

Commit

Permalink
fix(LittleFS): Use VFSImpl::exists() to avoid false error log
Browse files Browse the repository at this point in the history
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.
#7615
  • Loading branch information
BlueAndi committed Aug 21, 2024
1 parent 4098c53 commit dc67023
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions libraries/LittleFS/src/LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,10 @@ class LittleFSImpl : public VFSImpl {
public:
LittleFSImpl();
virtual ~LittleFSImpl() {}
virtual bool exists(const char *path);
};

LittleFSImpl::LittleFSImpl() {}

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

LittleFSFS::LittleFSFS() : FS(FSImplPtr(new LittleFSImpl())), partitionLabel_(NULL) {}

LittleFSFS::~LittleFSFS() {
Expand Down

0 comments on commit dc67023

Please sign in to comment.