#include <boost/filesystem/path.hpp>#include <boost/filesystem/operations.hpp>using namespace boost::filesystem;int main(){ directory_iterator dir(current_path()); return 0;}
void recursive_dir(std::string dir,std::string last){ std::string strWildcard = dir + "/*.*"; std::string lastDir = last; _finddata_t s_Dir; intptr_t hDir; if( (hDir = _findfirst( strWildcard.c_str(), &s_Dir )) == -1L ) return; do { if( s_Dir.name[ 0 ] != '.' && ( s_Dir.attrib & _A_SUBDIR )) { recursive_dir(dir + '/' + s_Dir.name,lastDir+"/"+s_Dir.name); }else if (s_Dir.name[ 0 ] != '.' ) std::cout << "File: " << lastDir << "/" << s_Dir.name << std::endl; } while( _findnext( hDir, &s_Dir ) == 0 ); _findclose( hDir ); return;}