
We are using Boost 1.34.0. This is something in the current version of Boost, which seems to only allow Directory paths to be used in a boost::filesystem::directory_iterator. So, the question I present would be whether or not there's another construct for doing this? My coworker found something in boost/regex/v4/fileiter.hpp called file_iterator, which seemed to achieve the correct result, but why isn't this part of Boost.Filesystem? Or is it and I'm just missing something? Thanks, Lawrence -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Nat Goodspeed Sent: Tuesday, October 02, 2007 4:16 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Boost.FileSystem] File or Wildcards in Path? How-to do this? Lawrence Spector wrote:
std::string folderName = "C:\\*.sys"; boost::filesystem::path fsDirectoryPath = boost::filesystem::system_complete( boost::filesystem::path(folderName, boost::filesystem::native)); boost::filesystem::directory_iterator end_iter;
for (boost::filesystem::directory_iterator dir_itr(fsDirectoryPath); dir_itr != end_iter; ++dir_itr) // throws exception { std::cout << "Contains the following file: " << dir_itr->string() << std::endl; } // end for
When I do this, I get the following exception:
boost::filesystem::basic_directory_iterator constructor
Are you using Boost 1.34? If not, it might be worth trying. If I'm right about the exception you're getting, I believe it's been eliminated in 1.34. If you're locked into a previous version of Boost, try passing boost::filesystem::no_check instead of boost::filesystem::native. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users