Skip to content
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

fix(littlefs): Use VFSImpl::exists() to avoid false error log #10217

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions libraries/FFat/src/FFat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,4 @@ size_t F_Fat::freeBytes() {
return free_sect * sect_size;
}

bool F_Fat::exists(const char *path) {
File f = open(path, "r", false);
return (f == true) && !f.isDirectory();
}

bool F_Fat::exists(const String &path) {
return exists(path.c_str());
}

F_Fat FFat = F_Fat(FSImplPtr(new VFSImpl()));
2 changes: 0 additions & 2 deletions libraries/FFat/src/FFat.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class F_Fat : public FS {
size_t usedBytes();
size_t freeBytes();
void end();
bool exists(const char *path);
bool exists(const String &path);

private:
wl_handle_t _wl_handle = WL_INVALID_HANDLE;
Expand Down
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
Loading