Skip to content

Commit cda1420

Browse files
committed
Fix SPIFFS path length check, add notes about FSInfo structure (esp8266#1273)
1 parent d460de8 commit cda1420

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cores/esp8266/spiffs_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ static bool isSpiffsFilenameValid(const char* name) {
495495
if (name == nullptr)
496496
return false;
497497
auto len = strlen(name);
498-
return len > 0 && len <= SPIFFS_OBJ_NAME_LEN;
498+
return len > 0 && len < SPIFFS_OBJ_NAME_LEN;
499499
}
500500

501501
// these symbols should be defined in the linker script for each flash layout

doc/filesystem.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,14 @@ struct FSInfo {
169169
};
170170
```
171171
172-
This is the structure which may be filled using FS::info method. Field names
173-
are self-explanatory.
172+
This is the structure which may be filled using FS::info method.
173+
- `totalBytes` — total size of useful data on the file system
174+
- `usedBytes` — number of bytes used by files
175+
- `blockSize` — SPIFFS block size
176+
- `pageSize` — SPIFFS logical page size
177+
- `maxOpenFiles` — max number of files which may be open simultaneously
178+
- `maxPathLength` — max file name length (including one byte for zero termination)
179+
174180
175181
## Directory object (Dir)
176182

0 commit comments

Comments
 (0)