When using boost_filesystem, Boost continues to add quotation marks to file names.
foo.cpp:
#include <iostream>
#include <boost/filesystem.hpp>
int main( int argc, char * argv[] )
{
std::cout << argv[0] << std::endl;
boost::filesystem::path p( argv[0] );
std::cout << p << std::endl;
std::cout << p.filename() << std::endl;
return 0;
}
Compiled by:
g++ foo.cpp -o foo -lboost_filesystem -lboost_system
Conclusion:
./foo
"./foo"
"foo"
This is somewhat unexpected and inconvenient in my case. Is this really intentional, or is it a slightly older version of the Boost (1.46.1) buggy in this regard? Is there any way to avoid adding them?
I looked through the documentation, but, apart from textbooks not showing these quotes in their output example, I was not enlightened.
source
share