diff --git a/src/slic3r/GUI/HMS.cpp b/src/slic3r/GUI/HMS.cpp index 203b2d3217..63ce64cb21 100644 --- a/src/slic3r/GUI/HMS.cpp +++ b/src/slic3r/GUI/HMS.cpp @@ -83,7 +83,11 @@ int HMSQuery::load_from_local(std::string &version_info) return -1; } std::string filename = get_hms_file(); - std::string dir_str = (boost::filesystem::path(data_dir()) / filename).make_preferred().string(); + auto hms_folder = (boost::filesystem::path(data_dir()) / "hms"); + if (!fs::exists(hms_folder)) + fs::create_directory(hms_folder); + + std::string dir_str = (hms_folder / filename).make_preferred().string(); std::ifstream json_file(encode_path(dir_str.c_str())); try { if (json_file.is_open()) { @@ -111,7 +115,10 @@ int HMSQuery::save_to_local() return -1; } std::string filename = get_hms_file(); - std::string dir_str = (boost::filesystem::path(data_dir()) / filename).make_preferred().string(); + auto hms_folder = (boost::filesystem::path(data_dir()) / "hms"); + if (!fs::exists(hms_folder)) + fs::create_directory(hms_folder); + std::string dir_str = (hms_folder / filename).make_preferred().string(); std::ofstream json_file(encode_path(dir_str.c_str())); if (json_file.is_open()) { json_file << std::setw(4) << m_hms_json << std::endl;