1 // filesystem tut6a.cpp --------------------------------------------------------------//
3 // Copyright Beman Dawes 2010
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 // Library home page: http://www.boost.org/libs/filesystem
12 #include <boost/filesystem.hpp>
13 using namespace boost::filesystem
;
15 int main(int argc
, char* argv
[])
19 std::cout
<< "Usage: tut6a path\n";
25 for (recursive_directory_iterator
it (argv
[1]);
26 it
!= recursive_directory_iterator();
33 for (int i
= 0; i
<= it
.level(); ++i
)
36 std::cout
<< it
->path() << '\n';
41 catch (const std::exception
& ex
)
43 std::cout
<< "************* exception *****************\n";
44 std::cout
<< ex
.what() << '\n';