I noticed something which looks pretty much like a bug in the filesystem
library. Both version 1.34.1 and CVS are affected under Linux. I do not
know about other versions/platforms.
If I compile and run the following code
-----------------------------------
#include
#include <iostream>
int main(int argc, char *argv[])
{
boost::filesystem::wpath p(L"/");
boost::filesystem::wdirectory_iterator i(p);
return 0;
}
-----------------------------------
then I get an exception:
-----------------------------------
terminate called after throwing an instance of
'boost::filesystem::basic_filesystem_error, std::allocator >,
boost::filesystem::wpath_traits> >'
what(): boost::filesystem::wpath::to_external conversion error: Invalid
argument
Aborted
-----------------------------------
However, the following alternate version (which uses char instead of
wchar_t) works:
-----------------------------------
#include
#include <iostream>
int main(int argc, char *argv[])
{
boost::filesystem::path p("/");
boost::filesystem::directory_iterator i(p);
return 0;
}
-----------------------------------
Has anyone ever found a way to cope with that or filed a bug?
Thanks -- Olivier