Created
March 10, 2011 09:11
-
-
Save moriyoshi/863800 to your computer and use it in GitHub Desktop.
Recursively traverse directories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/filesystem/convenience.hpp> | |
#include <boost/foreach.hpp> | |
#include <boost/range.hpp> | |
#include <iostream> | |
int main(int, char**) | |
{ | |
namespace bf = boost::filesystem; | |
BOOST_FOREACH(bf::path path, | |
boost::make_iterator_range( | |
bf::recursive_directory_iterator(bf::path("/home")), | |
bf::recursive_directory_iterator())) { | |
std::cout << path.string() << std::endl; | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment