nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ sd_card_list_files()

int sd_card_list_files ( char const *const path,
char * buf,
size_t * buf_size,
bool extra_info )

Print out the contents under SD card root path and write the content to buffer.

Parameters
[in]pathPath of the folder which is going to be listed. If assigned path is NULL, then listing the contents under root. If assigned path doesn't exist, an error will be returned.
[out]bufBuffer where data is written. If set to NULL, it will be ignored.
[in,out]buf_sizeBuffer size.
[in]extra_infoWill append DIR/FILE info to string.
Return values
0on success.
-EPERMSD card operation is ongoing somewhere else.
-ENODEVSD init failed. SD card likely not inserted.
-EINVALFailed to append to buffer.
-FR_INVALID_NAMEPath is too long.
Otherwise,errorfrom underlying drivers.