8000 Question about file overwriting and big files · Issue #123 · littlefs-project/littlefs · GitHub
[go: up one dir, main page]

Skip to content
Question about file overwriting and big files #123
@davidefer

Description

@davidefer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0