diff --git a/src/Classic/Fields/Fieldmap.cpp b/src/Classic/Fields/Fieldmap.cpp index b8eb3e6b4e75e6c8a58ca56ef90b2d4e931f2ad4..abaac55f96c8350746584159b130b7c5e8ed8af2 100644 --- a/src/Classic/Fields/Fieldmap.cpp +++ b/src/Classic/Fields/Fieldmap.cpp @@ -740,10 +740,10 @@ void Fieldmap::write3DField(unsigned int nx, if (Ippl::myNode() != 0 || (ef.size() != numpoints && bf.size() != numpoints)) return; - size_t extensionStart = Filename_m.find_last_of('.'); + boost::filesystem::path p(Filename_m); std::string fname = Util::combineFilePath({ OpalData::getInstance()->getAuxiliaryOutputDirectory(), - Filename_m.substr(0,extensionStart) + ".vtk" + p.stem().string() + ".vtk" }); std::ofstream of; of.open (fname);