And one of the big reasons for enumerating a directory is to check sizes and attributes (Read only, Archive, etc.)
Actually, I've not seen an out of order listing since before Win2000 ... so unless our friend is using an antique computer, it shouldn't be a problem.Newer versions of Windows will sort the filenames alphabetically by name, in limited testing on Win7. Older versions did not always do that, however. (Thus the sort option).
By the time you parse the strings (or file), move them into an array, etc. Code wise it's about a tie.Are you saying that using the API and a linked list for this, is as easy as using a one line system call, and then reading the results back from the file using fgets()?
WIN32_FIND_DATA structureUsing system calls is not as elegant as using the API, but in this case, it seems much easier (it would be for me, at least), and appropriate. I agree there is extra memory and a time penalty for shelling out to the system. Well worth it, imo.
Not when you realize what the API call gives you...