diff --git a/cores/esp8266/spiffs_api.cpp b/cores/esp8266/spiffs_api.cpp index f189b4d4e..77b9c2ea2 100644 --- a/cores/esp8266/spiffs_api.cpp +++ b/cores/esp8266/spiffs_api.cpp @@ -495,7 +495,7 @@ static bool isSpiffsFilenameValid(const char* name) { if (name == nullptr) return false; auto len = strlen(name); - return len > 0 && len <= SPIFFS_OBJ_NAME_LEN; + return len > 0 && len < SPIFFS_OBJ_NAME_LEN; } // these symbols should be defined in the linker script for each flash layout diff --git a/doc/filesystem.md b/doc/filesystem.md index 4beae1e15..d903bcede 100644 --- a/doc/filesystem.md +++ b/doc/filesystem.md @@ -169,8 +169,14 @@ struct FSInfo { }; ``` -This is the structure which may be filled using FS::info method. Field names -are self-explanatory. +This is the structure which may be filled using FS::info method. +- `totalBytes` — total size of useful data on the file system +- `usedBytes` — number of bytes used by files +- `blockSize` — SPIFFS block size +- `pageSize` — SPIFFS logical page size +- `maxOpenFiles` — max number of files which may be open simultaneously +- `maxPathLength` — max file name length (including one byte for zero termination) + ## Directory object (Dir)