Remove DirDelete, implementation did not work and memory contraints are recursive. Better implemented on client side...

This commit is contained in:
Tim Keller 2021-10-26 00:48:25 +00:00
parent 2e10b0fe64
commit f4322841ff
2 changed files with 2 additions and 18 deletions

View File

@ -102,23 +102,6 @@ int FS::Stat(const char* path, lfs_info* info) {
lfs_ssize_t FS::GetFSSize() { lfs_ssize_t FS::GetFSSize() {
return lfs_fs_size(&lfs); 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;
}
/* /*

View File

@ -26,10 +26,11 @@ namespace Pinetime {
int DirRead(lfs_dir_t* dir, lfs_info* info); int DirRead(lfs_dir_t* dir, lfs_info* info);
int DirRewind(lfs_dir_t* dir); int DirRewind(lfs_dir_t* dir);
int DirCreate(const char* path); int DirCreate(const char* path);
int DirDelete(const char* path);
lfs_ssize_t GetFSSize(); lfs_ssize_t GetFSSize();
int Stat(const char* path, lfs_info* info); int Stat(const char* path, lfs_info* info);
void VerifyResource(); void VerifyResource();
static size_t getSize() { static size_t getSize() {
return size; return size;
} }