littlefs-project / littlefs

A little fail-safe filesystem designed for microcontrollers
BSD 3-Clause "New" or "Revised" License
4.9k stars 770 forks source link

used and free memory #980

Closed stingdau1206 closed 1 month ago

stingdau1206 commented 1 month ago

in file system info, i don't see value that show num of bytes is available, or num of bytes is used how can i get it ?

geky commented 1 month ago

Hi @stingdau1206,

lfs_fs_size returns the number of blocks currently in use. If you multiply this by the block_size the result should be the number of bytes in use.

Because littlefs uses copy-on-write data-structures, the result may sometimes be larger than the actual usage, but it should never be smaller. Hopefully it's still useful for estimating how full the disk is.

stingdau1206 commented 1 month ago

Hi @geky thanks for your reply, i'm Looking forward to a more detailed result about disk usage but, after all, it will be ok for my case