Click to See Complete Forum and Search --> : Getting sorted list of files


Bernhard Reif
May 19th, 1999, 01:56 AM
How can I retrieve a sorted list of files in a specific directory? I have to sort this list in different ways. I don't want to display a dialog box (like CFileDialog).
This issue is especially for a large amount of files in this directory

Who knows how to do this?

Thanks in advance

Jason Teagle
May 19th, 1999, 03:14 AM
::FindFirstFile() and ::FindNextFile() can retrieve a list of files in long filename format, including a specific set if desired ("*.TXT", "AP_*.DEF", etc) - but sorting is up to you. I'm sure there are plenty of algorithms for sorting text.

Jaeyeon Lee
May 19th, 1999, 04:13 AM
You can use qsort function for sorting.