Date: Sun, 17 Jan 1999 12:15:01 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Tim Hoskins cc: djgpp AT delorie DOT com Subject: Re: Alphabeticallize _dos_findfirst and _dos_findnext? In-Reply-To: <01be403b$7951ba80$0100007f@tim-hoskins> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com 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.