On Fri, May 28, 2021 at 9:21 PM Flavio Castro Alves Filho <flavio.al...@gmail.com> wrote: > > Hello, > > I am using LittleFS to store information on an external dataflash. > > I need to know if the memory is full. I saw that the nsh provides the > df command, which as far as I understood is a cat for /proc/fs/usage > file. > > In my code, I could see the LFS message indicating LFS_ERR_NOSPC, > which is an error message indicating no more space when writing files. > But the return from the fwrite call is OK (indicating the number of > written bytes) :-|
if your FILE is buffered, you may just need fflush or fclose and check the error. in that case, it's an expected behavior. otherwise, sounds like a bug in the OS. > > Is /proc/fs/usage available for LittleFS? Is there any way to get the > disk space programmatically? > > Best regards, > > Flavio > > -- > Flavio de Castro Alves Filho > > flavio.al...@gmail.com > Twitter: http://twitter.com/#!/fraviofii > LinkedIn profile: www.linkedin.com/in/flaviocastroalves