|
Boost Users : |
From: Lothar May (L-MAY_at_[hidden])
Date: 2007-11-24 15:27:01
Hi,
I have a strange problem that an exception thrown by a boost::filesystem directory_iterator is not caugth on MacOS X. Please consider the following code:
("const string &dir" is a parameter)
bool retVal = true;
try
{
directory_iterator i(dir);
directory_iterator end;
while (i != end)
{
// do something
++i;
}
} catch (...)
{
retVal = false;
}
While this works perfectly on Windows and Linux (the exception is caught fine), on MacOS I get the following:
terminate called after throwing an instance of 'boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::string, boost::filesystem::path_traits> >'
what(): boost::filesystem::basic_directory_iterator constructor
Abort trap
The program runs fine (withouth the trap) if I comment out the upper lines.
I use the boost 1.34.0 lib built as universal binary on MacOS 10.5, according to the instructions at http://svn.boost.org/trac/boost/wiki/CMakeConfigAndBuild
I link to the static non-debug mt version of boost_filesystem. Exceptions within my program are caught fine, just this boost exception is not caught. The program is also compiled as non-debug.
Any help would be very much appreciated.
Regards,
Lothar
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