Skip to content

Commit 019855f

Browse files
BlueAndilucasssvaz
andauthored
fix(littlefs): Use VFSImpl::exists() to avoid false error log (#10217)
* fix(littlefs): Use VFSImpl::exists() to avoid false error log * fix(ffat): Use VFSImpl::exists() to avoid false error log --------- Co-authored-by: Lucas Saavedra Vaz <[email protected]>
1 parent 396def3 commit 019855f

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

libraries/FFat/src/FFat.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,4 @@ size_t F_Fat::freeBytes() {
152152
return free_sect * sect_size;
153153
}
154154

155-
bool F_Fat::exists(const char *path) {
156-
File f = open(path, "r", false);
157-
return (f == true) && !f.isDirectory();
158-
}
159-
160-
bool F_Fat::exists(const String &path) {
161-
return exists(path.c_str());
162-
}
163-
164155
F_Fat FFat = F_Fat(FSImplPtr(new VFSImpl()));

libraries/FFat/src/FFat.h

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class F_Fat : public FS {
3232
size_t usedBytes();
3333
size_t freeBytes();
3434
void end();
35-
bool exists(const char *path);
36-
bool exists(const String &path);
3735

3836
private:
3937
wl_handle_t _wl_handle = WL_INVALID_HANDLE;

libraries/LittleFS/src/LittleFS.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,10 @@ class LittleFSImpl : public VFSImpl {
3333
public:
3434
LittleFSImpl();
3535
virtual ~LittleFSImpl() {}
36-
virtual bool exists(const char *path);
3736
};
3837

3938
LittleFSImpl::LittleFSImpl() {}
4039

41-
bool LittleFSImpl::exists(const char *path) {
42-
File f = open(path, "r", false);
43-
return (f == true);
44-
}
45-
4640
LittleFSFS::LittleFSFS() : FS(FSImplPtr(new LittleFSImpl())), partitionLabel_(NULL) {}
4741

4842
LittleFSFS::~LittleFSFS() {

0 commit comments

Comments
 (0)