
"Janusz Piwowarski" <jpiw@go2.pl> wrote in message news:002601c40b5c$96b7c820$2900050a@januszpXP...
I just had a look at boost::filesystem, and it felt really good to use. There is one common idiom that might be worth including: recursive traversal.
So I would like some like
recursive_directory_iterator i( path( "foo" ) ) , end; for( i.set_traversal_mode( files_only ); i != end; ++ i ) // print all file names recursively, default could be both dirs and files cout << i->leaf();
I like it; i suggest breadth_first_search | depth_first_search extra traversal modes.
I like breadth_first_search and depth_first_search much more than files_only. If you want to only look at files, you can do recursive_directory_iterator i( path( "foo" ), breadth_first_search ) , end; for ( ; i != end; ++i) { if (is_directory(*i)) continue; ... } Joe Gottman Joe Gottman