From 7e0a2644e2e29d4d7be3d5961731fd26f991a35d Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 11 Aug 2021 13:38:28 +0200 Subject: [PATCH] Fixup of previous commit --- src/libslic3r/GCode/PostProcessor.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/GCode/PostProcessor.cpp b/src/libslic3r/GCode/PostProcessor.cpp index 453fddaa3..27b2254e9 100644 --- a/src/libslic3r/GCode/PostProcessor.cpp +++ b/src/libslic3r/GCode/PostProcessor.cpp @@ -290,10 +290,11 @@ bool run_post_process_scripts(std::string &src_path, bool make_copy, const std:: f.close(); if (host == "File") { - boost::filesystem::path op(new_output_name); + namespace fs = boost::filesystem; + fs::path op(new_output_name); if (op.is_relative() && op.has_filename() && op.parent_path().empty()) { // Is this just a filename? Make it an absolute path. - auto outpath = boost::filesystem::path(output_name).parent_path(); + auto outpath = fs::path(output_name).parent_path(); outpath /= op.string(); new_output_name = outpath.string(); } @@ -301,8 +302,9 @@ bool run_post_process_scripts(std::string &src_path, bool make_copy, const std:: if (! op.is_absolute() || ! op.has_filename()) throw Slic3r::RuntimeError("Unable to parse desired new path from output name file"); } - if (! boost::filesystem::exists(op.parent_path())) - throw Slic3r::RuntimeError(Slic3r::format("Output directory does not exist: %1%", op.parent_path().string())); + if (! fs::exists(fs::path(new_output_name).parent_path())) + throw Slic3r::RuntimeError(Slic3r::format("Output directory does not exist: %1%", + fs::path(new_output_name).parent_path().string())); } BOOST_LOG_TRIVIAL(trace) << "Post-processing script changed the file name from " << output_name << " to " << new_output_name;