Это код, который я использую для записи структуры дерева свойств Boost в файл: < /p>
void writeConfigurationFile(std::string filePath, boost::property_tree::ptree &configurationTree)
{
try
{
boost::property_tree::write_json(filePath, configurationTree);
}
catch (boost::property_tree::ptree_bad_path &e)
{
LOGGER_EXCEPTION(std::string("boost::property_tree::ptree_bad_path => what:").append(e.what()).c_str());
}
catch (boost::property_tree::ptree_error &e)
{
LOGGER_EXCEPTION(std::string("boost::property_tree::ptree_error => what:").append(e.what()).c_str());
}
catch (...)
{
LOGGER_EXCEPTION("Exception occurred in writing Configuration file");
}
}
< /code>
Я получаю исключение < /p>
LOGGER_EXCEPTION: boost::property_tree::ptree_error => what:configuration.json: cannot open file.
< /code>
Однако я вижу, что файл очень много присутствует. Есть ли причина, почему это потерпит неудачу?>
Подробнее здесь: https://stackoverflow.com/questions/744 ... -open-file