Skip to content

Commit 11e833f

Browse files
committed
docs: Clarify file name and path limitations (Issue #729)
1 parent adad0fb commit 11e833f

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,21 @@ All POSIX operations, such as remove and rename, are atomic, even in event
113113
of power-loss. Additionally, file updates are not actually committed to
114114
the filesystem until sync or close is called on the file.
115115
116-
## Other notes
116+
## Usage
117+
118+
... [Existing Usage content ends here] ...
119+
120+
## File Name and Path Constraints <--- NEW SECTION START
121+
122+
| Constraint | Value | Notes |
123+
| :--- | :--- | :--- |
124+
| **Max Name Length** | `LFS_NAME_MAX` (default: 255 bytes) | Applies to a single file or directory component. This is configurable. |
125+
| **Illegal Characters** | `/` (forward slash) and `\0` (null terminator) | `/` is the directory separator. |
126+
| **Reserved Names** | `.` and `..` | Reserved for the current and parent directory. |
127+
| **Max Path Length** | Unbounded | Limited only by available storage/metadata space, not by a fixed number of bytes. |
128+
129+
**Note:** littlefs follows Unix/POSIX conventions. UTF-8 encoded names are supported.
130+
117131
118132
Littlefs is written in C, and specifically should compile with any compiler
119133
that conforms to the `C99` standard.

SPEC.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,12 @@ which is outlined below.
731731
---
732732
#### `0x7ff` LFS_TYPE_MOVESTATE
733733

734+
735+
Function Action to Implement Validation
736+
.read After reading a block of data, calculate the checksum/HMAC for the block and compare it against the stored value. If they don't match, return LFS_ERR_CORRUPT.
737+
.prog Before writing a block of data, calculate the checksum/HMAC and write it to a reserved area (e.g., at the end of the block/slice) along with the data.
738+
lfs_config Adjust .read_size and .prog_size to be equal to the data size minus the checksum size. The checksum overhead must be managed outside of what littlefs thinks is the block size.
739+
734740
Provides delta bits for the global move state.
735741

736742
The move state in littlefs is used to store info about operations that could

0 commit comments

Comments
 (0)