-
Notifications
You must be signed in to change notification settings - Fork 866
Available space #45
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 davidefer,
It counts the allocated block then as we know the number of total block we can know how many block are available |
Thank you guillaumerems, it works. |
Thanks @guillaumerems! It sounds like we should probably add a lfs_fs_size function or something since this feature has been requested fairly often. @davidefer, littlefs itself doesn't actually know which blocks are bad until it tries to write to them. It just doesn't store this information. |
I went ahead and tacked on a |
I tried this code and it works if I mount the fs and check before and after an operation. However, if I unmount and remount, this number appears to reset to the original value before I did the operation. Am I missing something simple? |
@tomvarghese, that should not happen. Is it possible to create a small program that reproduces this? Thanks. |
I just found the problem yesterday evening. It was a bug in my code, was not closing the file before unmounting.
Thanks for your response though. Really appreciate it.
Tom
From: Christopher Haster <[email protected]>
Sent: Monday, April 1, 2019 12:57 AM
To: ARMmbed/littlefs <[email protected]>
Cc: Thomas Varghese <[email protected]>; Mention <[email protected]>
Subject: Re: [ARMmbed/littlefs] Available space (#45)
@tomvarghese<https://github.com/tomvarghese>, that should not happen. Is it possible to create a small program that reproduces this? Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#45 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AN9FN1bcJpYOSiIrRxe5D-ufOhXGpfRCks5vcZ-YgaJpZM4S-txS>.
|
Hi
first of all thank you very much for having developed littlefs.
I have a question concerning the available space on the storage: how to calculate it?
Thank you in advance.
The text was updated successfully, but these errors were encountered: