-
Notifications
You must be signed in to change notification settings - Fork 844
File too large when writing #1066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @BlazejKrysztofiak, thanks for creating an issue. That is curious. I've not seen any issues related to LFS_ERR_FBIG before, the relevant logic is honestly pretty simple: Lines 3673 to 3676 in 0494ce7
Is it possible I would also check that the file is open and hasn't been closed before the write call. Enabling asserts would help catch this, if they're disabled. |
It's also worth mentioning running out of space is reported as LFS_ERR_NOSPC, which is what makes LFS_ERR_FBIG curious. It's only possible to get this if you seek close to the file limit, which is INT_MAX by default: Lines 54 to 59 in 0494ce7
Unless you are on a 16-bit system? |
Hi @geky Thank you for answering. I have asserts enabled. I am not seeking around the file as I have it opened in "append" mode and I am only adding new data to the end of the file. I am using 32 bit STM32G474. I did not checked size of the file after I got error because my code is removing the file if all data was not saved correctly. Probably I wrongly calculated data size which I wanted to save and I exceeded LFS_FILE_MAX. Unfortunately I do not have the code which caused it any longer. Requirements in the project changed and I do not have to save so much data any longer. |
Ah, if you passed a huge size to It would have to be > ~2GiB though, since that's the signed 32-bit limit. But let us know if you run into this again. |
Okay, thank you 👍 |
Hi
I am using littleFs with W25Q64JV NAND memory and I am trying to save about 1.7M byte data to file by appending it with smaller data chunks (about 20 bytes each). On some point lfs_file_write() function is returning error code LFS_ERR_FBIG.
My configuration:
My sync function is not implemented, it basically returns LFS_ERR_OK.
Do I try to write too much data into single file? Maybe I should close the file somewhere between writes and then reopen it?
The text was updated successfully, but these errors were encountered: