add file name()

This commit is contained in:
hathach committed 2018-10-17 20:52:31 +07:00
1 parent 40141a1f30
commit 7af34049ea
3 files changed
+16 -6

No files matched your search

+3
View File
@@ -35,6 +35,7 @@
/**************************************************************************/
#include <Arduino.h>
#include <string.h>
#include "InternalFS.h"
#include "flash/flash_nrf52.h"
@@ -238,6 +239,8 @@ BluefuritLib::File LittleFS::_openByInfo (struct lfs_info *info, uint8_t mode)
{
file._hdl = fhdl;
file._is_dir = (info->type == LFS_TYPE_DIR);
file._name = (char*) rtos_malloc(strlen(info->name) + 1);
strcpy(file._name, info->name);
}
}