Boost logo

Boost Users :

From: Lawrence Spector (Lawrence.Spector_at_[hidden])
Date: 2007-10-02 16:53:19


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_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Nat Goodspeed
Sent: Tuesday, October 02, 2007 4:16 PM
To: boost-users_at_[hidden]
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_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net