-
Notifications
You must be signed in to change notification settings - Fork 884
Description
Hi
I have a question about overwriting big files in LittleFS.
My file system consists of 32KB flash blocks with the following dimension (after format):
Total space 2064384
Used space 131072
Free space 1933312
If I write a 1MB (1024*1024) bytes file everything works.
The state is as follow:
Total space 2064384
Used space 1212416
Free space 851968
Now if I re-write the same file (LFS_O_WRONLY | LFS_O_CREAT | LFS_O_TRUNC) without deleting it, then I get an error "no more space" while writing.
The state is as follow:
Total space 2064384
Used space 2064384
Free space 0
Please note that if I delete the file before overwriting it, then everything works.
I wanted to know what is the reason for that and if there is a general rule for the restrictions one must cope with when dealing with big files.
Thanks in advance