Hello,
I'm using Boost 1.46.1 with filesystem v3. Code that I've been running successfully on Windows, Linux and FreeBSD started producing very mysterious results on Solaris. I boiled it down to this: boost::filesystem will not identify a directory as a directory. Here's a test program:
#include <boost/filesystem.hpp>
int main()
{
try
{
boost::filesystem::path d(boost::filesystem::absolute("dir"));
if (boost::filesystem::exists(d))
{
std::cout << d << " already exists" << std::endl;
}
else
{
boost::filesystem::create_directory(d);
std::cout << d << " is " << (boost::filesystem::is_directory(d) ? "" : "not") <<
" a directory" << std::endl;
}
}
catch (std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
}
return 0;
}
And here is a snippet of a terminal session compiling and running the program:
$ CC -o fstest fstest.cpp -library=stlport4 -Iexternal/solaris/x86/64/suncc/5.11/include external/solaris/x86/64/suncc/5.11/lib/libboost_filesystem.a external/solaris/x86/64/suncc/5.11/lib/libboost_system.a
$ ./fstest
"/export/home/will/Projects/cap/dir" is not a directory
$ file /export/home/will/Projects/cap/dir
/export/home/will/Projects/cap/dir: directory
$
Thanks for any help,
Will