Reputation: 2505
I'm wondering how do you do stuff like gettling file information, searching through directories/subdirectories in c++? Is there a particular library that I should be looking at?
I'm seeing stuff like this in some examples:
#include <sys/types.h>
#include <sys/stat.h>
Not sure where they came from.. Thanks!
EDIT: I'm programming in Windows btw
Upvotes: 0
Views: 2430
Reputation: 11925
If you are using MFC, see CFileFind. Even if you aren't, check out its implementation (if you are using Visual Studio and have installed the MFC source).
Upvotes: 1
Reputation:
Standard C++ has no directory access functions. On Windows, your choice is between a cross platform library such as Boost, or use of the Windows native FindFirstFile and associated functions.
Upvotes: 0
Reputation: 57892
In windows you can use the Win32 API - FindFirstFile & FindNextFile for searching in folders, and various GetFileXXX calls.
See here for more info: MSDN information on file APIs
Upvotes: 4