From 9c66c69a48da4f0b0462eac597dc5a92ec968602 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 17 Oct 2018 17:08:31 +0700 Subject: [PATCH] add exists, mkdir, remove, rmdir --- libraries/FileSystem/src/InternalFS.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libraries/FileSystem/src/InternalFS.cpp b/libraries/FileSystem/src/InternalFS.cpp index 1fc07aba..356d9a4e 100644 --- a/libraries/FileSystem/src/InternalFS.cpp +++ b/libraries/FileSystem/src/InternalFS.cpp @@ -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; } //--------------------------------------------------------------------+