Quote Originally Posted by Adak View Post
The dir options I posted above, will give ONLY the filenames, and no other information.
And one of the big reasons for enumerating a directory is to check sizes and attributes (Read only, Archive, etc.)

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).
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.


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()?
By the time you parse the strings (or file), move them into an array, etc. Code wise it's about a tie.


Using 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.
WIN32_FIND_DATA structure

Not when you realize what the API call gives you...