Traversing Cluster
for(uint32_t i = 0; i < bpc / sizeof(struct msdos_dir_entry); i++) {
struct msdos_dir_entry dir_entry;
size_t ret = fread(&dir_entry, 1, sizeof(struct msdos_dir_entry), fp);
if(dir_entry.name[0] != 0x00) {
if(dir_entry.attr != 0x0f) {
// Insert your code here
/*
Read the file name:
1. Check whether the file is deleted or not
2. Convert to 8.3 format names
3. Check whether it is a subdirectory
uint32_t dir_first_cluster = get_dir_first_cluster(&dir_entry);
printf("%d, ", _);
printf("%s, ", _);
printf("%d, ", _);
printf("%d", _);
printf("\n");
*/
}
else {
printf("%d, LFN entry\n", idx++);
}
}Last updated