Sort a list of file paths without using memory or array in C?

183 Views Asked by At

I Use ELM Chan fatfs library for file system. This application reads a USB memory MSC. I want to read all the MP3 files in root directory in a sorted manner but I can not use an array to save all the file paths, Number of files exceeds ram memory of my microcontroller. I have the bellow idea.

  1. function that save the index of the MP3 files in an (array of indexes)
  2. A function that gets file name based on the f_readdir index that was saved in (array of indexes)
  3. Sort (array of indexes) based on the bubble sort.
  4. read file based on this sorted indexes array

Is This a viable solution? I think this method is really slow

0

There are 0 best solutions below