1 // filesystem tut6b.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: tut6b path\n";
25 for (recursive_directory_iterator
it (argv
[1]);
26 it
!= recursive_directory_iterator();
29 for (int i
= 0; i
<= it
.level(); ++i
)
32 std::cout
<< it
->path() << '\n';
35 catch (const filesystem_error
& ex
)
37 std::cout
<< "************* filesystem_error *****************\n";
38 std::cout
<< ex
.what() << '\n';
43 catch (const std::exception
& ex
)
45 std::cout
<< "************* exception *****************\n";
46 std::cout
<< ex
.what() << '\n';