tags:

views:

91

answers:

2

Hi, which function windows is calling to list the files in a directory ?

thanks

A: 

Didn't exactly get your question but won't using "dir" as system command do the job? Correct me if I am wrong, coz the question itself wasn't very clear to me.

Edit - Hi John, this is the source code for listing directories.

http://msdn.microsoft.com/en-us/library/aa365200(VS.85).aspx

Hope this helps.

Elitecoder
I will be able to answer better if the question becomes clearer to me so if someone understands the question better, can they please edit it?
Elitecoder
Hey,in other words, im looking for the function that dir is using to list the files in a dirthanks
I guess the dir command does it similarly
jitter
+4  A: 

You can use this functions to do a directory listing with the WIN32 API.

FindFirstFile, FindNextFile and FindClose

A full example can be found here

Listing the Files in a Directory WIN32 API

For a portable approach check this post:

"Get list of files in a directory using c/c++"

jitter