From b5b783e508b7dd8502290e17b9114e18fb588810 Mon Sep 17 00:00:00 2001 From: ficeto Date: Sat, 16 May 2015 13:16:38 +0300 Subject: [PATCH] add access to SPIFFS properties --- cores/esp8266/FileSystem.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cores/esp8266/FileSystem.h b/cores/esp8266/FileSystem.h index 29173cb4e..012bdc45b 100755 --- a/cores/esp8266/FileSystem.h +++ b/cores/esp8266/FileSystem.h @@ -96,6 +96,13 @@ public: bool create(const char *filepath); bool remove(const char *filepath); bool rename(const char *filename, const char *newname); + size_t size(){ return _filesystemStorageHandle.cfg.phys_size; } + size_t blockSize(){ return _filesystemStorageHandle.cfg.log_block_size; } + size_t totalBlocks(){ return _filesystemStorageHandle.block_count; } + size_t freeBlocks(){ return _filesystemStorageHandle.free_blocks; } + size_t pageSize(){ return _filesystemStorageHandle.cfg.log_page_size; } + size_t allocatedPages(){ return _filesystemStorageHandle.stats_p_allocated; } + size_t deletedPages(){ return _filesystemStorageHandle.stats_p_deleted; } FSFile open(const char *filename, uint8_t mode = FSFILE_READ); FSFile open(spiffs_dirent* entry, uint8_t mode = FSFILE_READ);