Archived

This topic is now archived and is closed to further replies.

Find All Files in a Directory

This topic is 5127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know how to find all the files in a Windows directory using c++. I know there is a MFC class class CFileFind that will let you doe this, but I am creating a game using OpenGL and it will not let me #include <afx.h> b/c it says that has already been included. I want to have a directory called [Maps], and then get all the maps that are in that directory. Thanks, Scott

Share this post


Link to post
Share on other sites
quote:
Original post by scottdewald
Does anyone know how to find all the files in a Windows directory using c++. I know there is a MFC class class CFileFind that will let you doe this, but I am creating a game using OpenGL and it will not let me #include <afx.h> b/c it says that has already been included. I want to have a directory called [Maps], and then get all the maps that are in that directory.

Thanks,

Scott


Look up the functions, FindFirstFile, and FindNextFile, this is what you would use for finding files.

Share this post


Link to post
Share on other sites
boost::filesystem::directory_iterator


- Magmai Kai Holmlor

Not For Rent

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]

Share this post


Link to post
Share on other sites