how to find the size of a file within the file system ?

hello Nordic

i am working with ncs v2.5.0 with nrf52840 

i am using lfs to save the device configurations in a file

when reading this file i need to allocate a buffer for it and i am surprise that i did not find any API for that

there is an api for opendir that includes a field of size and if it is different from zero then it is the a file otherwise its a dir but i am not sure it is the right what to do that  

so, is there a straight foreword API i can use to know the size of the file saved in file system ? 

hope to read you soon

best regards

Ziv

Related