This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

List files in alphabetical order

How to use Fatfs file system module to list files in ALPHABETICAL ORDER? I tried f_readdir(&dir, fileinfo);, but it does not retrieve files in order. Please help

Parents
  • FatFs is just the low-level file systesm - things like sorting need to be done at a higher level in the application.

    "The f_readdir function reads directory entries in sequence. All items in the directory can be read by calling f_readdir function repeatedly. When all directory entries have been read and no item to read, the function returns a null string into f_name[] member without any error. When a null pointer is given to the FileInfo, the read index of the directory object will be rewinded."

    elm-chan.org/.../readdir.html

    If you want it sorted, you have to do that yourself.

Reply
  • FatFs is just the low-level file systesm - things like sorting need to be done at a higher level in the application.

    "The f_readdir function reads directory entries in sequence. All items in the directory can be read by calling f_readdir function repeatedly. When all directory entries have been read and no item to read, the function returns a null string into f_name[] member without any error. When a null pointer is given to the FileInfo, the read index of the directory object will be rewinded."

    elm-chan.org/.../readdir.html

    If you want it sorted, you have to do that yourself.

Children
No data