John Terry
John Terry

Reputation:

is there a global function in windows to lists the files in a dir?

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

thanks

Upvotes: 1

Views: 191

Answers (2)

jitter
jitter

Reputation: 54605

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++"

Upvotes: 4

Elitecoder
Elitecoder

Reputation: 170

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.

Upvotes: 0

Related Questions