add exists, mkdir, remove, rmdir

This commit is contained in:
hathach committed 2018-10-17 17:08:31 +07:00
1 parent 823e1f425c
commit 9c66c69a48
1 file changed
+8 -4
+8 -4
View File
@@ -251,22 +251,26 @@ BluefuritLib::File LittleFS::open (char const *filename, uint8_t mode)
bool LittleFS::exists (char const *filepath)
{
struct lfs_info info;
return 0 == lfs_stat(&_lfs, filepath, &info);
}
bool LittleFS::mkdir (char const *filepath)
{
VERIFY_LFS(lfs_mkdir(&_lfs, filepath));
return true;
}
bool LittleFS::remove (char const *filepath)
{
VERIFY_LFS(lfs_remove(&_lfs, filepath));
return true;
}
bool LittleFS::rmdir (char const *filepath)
{
VERIFY_LFS(lfs_remove(&_lfs, filepath));
return true;
}
//--------------------------------------------------------------------+