From f4322841ffc011ea5c541e40e6aa73ab11ebd988 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 26 Oct 2021 00:48:25 +0000 Subject: [PATCH] Remove DirDelete, implementation did not work and memory contraints are recursive. Better implemented on client side... --- src/components/fs/FS.cpp | 17 ----------------- src/components/fs/FS.h | 3 ++- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/components/fs/FS.cpp b/src/components/fs/FS.cpp index 8d82c39d..79fb2222 100644 --- a/src/components/fs/FS.cpp +++ b/src/components/fs/FS.cpp @@ -102,23 +102,6 @@ int FS::Stat(const char* path, lfs_info* info) { lfs_ssize_t FS::GetFSSize() { return lfs_fs_size(&lfs); } -// Delete directory and all files inside -int FS::DirDelete(const char* path) { - - lfs_dir_t lfs_dir; - lfs_info entryInfo; - - int err; - err = lfs_dir_open(&lfs, &lfs_dir, path); - if (err) { - return err; - } - while (lfs_dir_read(&lfs, &lfs_dir, &entryInfo)) { - lfs_remove(&lfs, entryInfo.name); - } - lfs_dir_close(&lfs, &lfs_dir); - return LFS_ERR_OK; -} /* diff --git a/src/components/fs/FS.h b/src/components/fs/FS.h index 60dd8e51..da3bd273 100644 --- a/src/components/fs/FS.h +++ b/src/components/fs/FS.h @@ -26,10 +26,11 @@ namespace Pinetime { int DirRead(lfs_dir_t* dir, lfs_info* info); int DirRewind(lfs_dir_t* dir); int DirCreate(const char* path); - int DirDelete(const char* path); + lfs_ssize_t GetFSSize(); int Stat(const char* path, lfs_info* info); void VerifyResource(); + static size_t getSize() { return size; }