1
0
mirror of https://github.com/paboyle/Grid.git synced 2026-01-09 03:19:34 +00:00

Hadrons: more verbose directory creation error

This commit is contained in:
2018-05-07 18:12:22 +01:00
parent 27a4d4c951
commit 2017e4e3b4
2 changed files with 14 additions and 8 deletions

View File

@@ -170,11 +170,13 @@ protected:
{
ScidacWriter binWriter(evec[0]._grid->IsBoss());
XmlWriter xmlWriter("", "eigenPackPar");
std::string d = dirname(filename);
std::string d = dirname(filename);
int status = mkdir(d);
if (mkdir(d))
if (status)
{
HADRONS_ERROR(Io, "cannot create directory '" + d + "'");\
HADRONS_ERROR(Io, "cannot create directory '" + d
+ "' (status " + std::to_string(status) + ")");
}
xmlWriter.pushXmlString(record.operatorXml);
xmlWriter.pushXmlString(record.solverXml);
@@ -199,11 +201,13 @@ protected:
ScidacWriter binWriter(evec._grid->IsBoss());
XmlWriter xmlWriter("", "eigenPackPar");
VecRecord vecRecord;
std::string d = dirname(filename);
std::string d = dirname(filename);
int status = mkdir(d);
if (mkdir(d))
if (status)
{
HADRONS_ERROR(Io, "cannot create directory '" + d + "'");\
HADRONS_ERROR(Io, "cannot create directory '" + d
+ "' (status " + std::to_string(status) + ")");
}
xmlWriter.pushXmlString(record.operatorXml);
xmlWriter.pushXmlString(record.solverXml);