Subject: [Boost-bugs] [Boost C++ Libraries] #10641: boost::filesystem::path::parent_path() throws run time error locale::facet::_S_create_c_locale name not valid
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-09 17:48:37
#10641: boost::filesystem::path::parent_path() throws run time error
locale::facet::_S_create_c_locale name not valid
------------------------------+------------------------
Reporter: maxiaoyin@⦠| Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.56.0 | Severity: Problem
Keywords: filesystem |
------------------------------+------------------------
I have the following code under ubuntu 12.04 with gcc 4.3.6 .
{{{
#include <iostream>
#include <boost/filesystem/path.hpp>
using namespace std;
namespace fs = boost::filesystem
int main(int argc, char** argv)
{
try
{
fs::path my_path("test/test.txt");
cout << "current path is " << my_path << endl;
cout << "parent path is " << my_path.parent_path()
<< endl;
}
catch(std::exception& e) {
cerr << endl << "Error during execution: " << e.what() <<
endl << endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
}}}
I was able to create a path using the string "test/test.txt" and print out
the path as a string. However, when I was trying to access the
parent_path() or stem() or extension() the program will fail and throw
locale::facet::_S_create_c_locale name not valid error.
output:
current path is "test/test.txt"
Error during execution: locale::facet::_S_create_c_locale name not valid
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10641> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC