I am using the FatFs library to create and manage a file system on an SD card. The goal is to identify a file containing the firmware for the bootloader to update (or not) the device.
The procedure im following is the follwing:
DIR directory;
FILINFO filinfo;
f_findfirst(&directory, &filinfo, "", "firmware_");
To my understanding, the first file that starts with "firmware_" should be identified and the information stored in filinfo . This does work, but when I try to extract the name from filinfo.fname the name that has been extracted is the follwing: "\0IRMWA~1.BIN".
I don't know the reason why the naming of the file is extracted in this format. The idea would be to later take the second part of the file: "firmware_01_01_01" and perform a char to int conversion to process the version number, but I cannot extract the full string of the file name.
'\0'reminds me of deleted files - pmg"firmware_*". As it is, I think it searches for an exact match of"firmware_". - Paul Ogilviefilinfohave field for long names and for 8.3 names? - Paul Ogilvie