update file close() to support directory

This commit is contained in:
hathach committed 2018-10-17 17:21:49 +07:00
1 parent 1264eb8567
commit 0284917c82
4 files changed
+12 -5

No files matched your search

+9 -2
View File
@@ -308,9 +308,16 @@ uint32_t LittleFS::_f_size (void* fhdl)
return lfs_file_size(&_lfs, (lfs_file_t*) fhdl);
}
void LittleFS::_f_close (void* fhdl)
void LittleFS::_f_close (void* fhdl, bool is_dir)
{
lfs_file_close(&_lfs, (lfs_file_t*) fhdl);
if ( is_dir )
{
lfs_dir_close(&_lfs, (lfs_dir_t *) fhdl);
}
else
{
lfs_file_close(&_lfs, (lfs_file_t*) fhdl);
}
}
File LittleFS::_f_openNextFile (void* fhdl, uint8_t mode)