Commit 25dcf024 authored by Dave Moxey's avatar Dave Moxey
Browse files

Merge branch 'fix/remove-all-dir' of /opt/gitlab/repositories/nektar

parents 33eeda14 4cb8c93f
......@@ -58,6 +58,7 @@
namespace ptime = boost::posix_time;
namespace ip = boost::asio::ip;
namespace errc = boost::system::errc;
namespace Nektar
{
......@@ -149,8 +150,6 @@ namespace Nektar
TiXmlDeclaration * decl = new TiXmlDeclaration("1.0", "utf-8", "");
doc.LinkEndChild(decl);
cout << "Writing outfile: " << filename << endl;
TiXmlElement * root = new TiXmlElement("NEKTAR");
doc.LinkEndChild(root);
......@@ -477,8 +476,6 @@ namespace Nektar
ASSERTL0(fileNames.size() == elementList.size(),"Outfile names and list of elements ids does not match");
cout << "Writing multi-file data: " << outFile << endl;
TiXmlElement * root = new TiXmlElement("NEKTAR");
doc.LinkEndChild(root);
......@@ -1084,7 +1081,15 @@ namespace Nektar
fs::path specPath (outname);
// Remove any existing file which is in the way
fs::remove_all(specPath);
try
{
fs::remove_all(specPath);
}
catch (fs::filesystem_error& e)
{
ASSERTL0(e.code().value() == errc::no_such_file_or_directory,
"Filesystem error: " + string(e.what()));
}
// serial processing just add ending.
if(nprocs == 1)
......@@ -1107,7 +1112,14 @@ namespace Nektar
m_comm->AllReduce(elmtnums,LibUtilities::ReduceMax);
// Create the destination directory
fs::create_directory(specPath);
try
{
fs::create_directory(specPath);
}
catch (fs::filesystem_error& e)
{
ASSERTL0(false, "Filesystem error: " + string(e.what()));
}
// Collate per-process element lists on root process to generate
// the info file.
......@@ -1136,6 +1148,8 @@ namespace Nektar
// Write the Info.xml file
string infofile = LibUtilities::PortablePath(
specPath / fs::path("Info.xml"));
cout << "Writing: " << specPath << endl;
WriteMultiFldFileIDs(infofile, filenames, ElementIDs,
fieldmetadatamap);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment