[SOLVED] Sorting Order When Requesting Files from the File System

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [SOLVED] Sorting Order When Requesting Files from the File System

      Hello,

      Is there a way to set the order in which FS_FindFirstFile and FS_FindNextFile return the found files? It seems that the files are always returns with the oldest file first, but I would like to have it return the newest file first. Please see attachment. The first directory list is how the order is normally returned by the functions, but I would like to be able to get the second directory list order. Thanks!
      Images
      • Capture.JPG

        59.39 kB, 424×552, viewed 1,398 times
    • Hello,

      FS_FindFirstFile() and FS_FindNextFile() always return the directory entries in the order they are located physically on the storage device. Any other ordering will have to be implemented in the application.

      Best regards,
      Marius
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.