Mail Archives: djgpp/1999/01/17/05:16:26
On 14 Jan 1999, Tim Hoskins wrote:
> Is there a way to have _dos_findfirst() and _dos_findnext() return the
> files alphabetically?
Yes: sort them. `_dos_findfirst'/`_dos_findnext' return the files in
the order they are stored in the directory. A library function
`qsort' is the usual way of sorting strings.
One easy way of getting a sorted list is by calling the library
function `glob', because it sorts the files for you (`glob' calls
`findfirst' and `findnext' internally).
And btw, don't use _dos_findfirst/_dos_findnext, use
findfirst/findnext instead. The former don't support long file names
on Windows 9X.
- Raw text -