using lfs for bonding. Add rmdir_r()

This commit is contained in:
hathach committed 2018-10-18 17:10:59 +07:00
1 parent 22a7a7e66a
commit 7a6220146f
5 files changed
+58 -98

No files matched your search

+4
View File
@@ -111,8 +111,12 @@ class FileSystemClass
// Delete the file.
virtual bool remove (char const *filepath) = 0;
// Delete a folder (must be empty)
virtual bool rmdir (char const *filepath) = 0;
// Delete a folder (recursively)
virtual bool rmdir_r (char const *filepath) = 0;
//--------------------------------------------------------------------+
// Internal API, shouldn't call directly
//--------------------------------------------------------------------+
+6
View File
@@ -338,6 +338,12 @@ bool LittleFS::rmdir (char const *filepath)
return true;
}
bool LittleFS::rmdir_r (char const *filepath)
{
VERIFY_LFS(lfs_remove(&_lfs, filepath));
return true;
}
//--------------------------------------------------------------------+
// FILE API
//--------------------------------------------------------------------+
+1
View File
@@ -55,6 +55,7 @@ class LittleFS: public BluefuritLib::FileSystemClass
bool mkdir (char const *filepath);
bool remove (char const *filepath);
bool rmdir (char const *filepath);
bool rmdir_r (char const *filepath);
virtual size_t _f_write (void* fhdl, uint8_t const *buf, size_t size);
virtual int _f_read (void* fhdl, void *buf, uint16_t nbyte);