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 <32426024+lucasssvaz@users.noreply.github.com>
This commit is contained in:
parent
396def3f83
commit
019855ff90
3 changed files with 0 additions and 17 deletions
|
|
@ -152,13 +152,4 @@ size_t F_Fat::freeBytes() {
|
||||||
return free_sect * sect_size;
|
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()));
|
F_Fat FFat = F_Fat(FSImplPtr(new VFSImpl()));
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@ public:
|
||||||
size_t usedBytes();
|
size_t usedBytes();
|
||||||
size_t freeBytes();
|
size_t freeBytes();
|
||||||
void end();
|
void end();
|
||||||
bool exists(const char *path);
|
|
||||||
bool exists(const String &path);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wl_handle_t _wl_handle = WL_INVALID_HANDLE;
|
wl_handle_t _wl_handle = WL_INVALID_HANDLE;
|
||||||
|
|
|
||||||
|
|
@ -33,16 +33,10 @@ class LittleFSImpl : public VFSImpl {
|
||||||
public:
|
public:
|
||||||
LittleFSImpl();
|
LittleFSImpl();
|
||||||
virtual ~LittleFSImpl() {}
|
virtual ~LittleFSImpl() {}
|
||||||
virtual bool exists(const char *path);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LittleFSImpl::LittleFSImpl() {}
|
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() : FS(FSImplPtr(new LittleFSImpl())), partitionLabel_(NULL) {}
|
||||||
|
|
||||||
LittleFSFS::~LittleFSFS() {
|
LittleFSFS::~LittleFSFS() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue