mirror of
https://github.com/paboyle/Grid.git
synced 2025-08-02 12:47:07 +01:00
Hadrons: better handling of automatic directory creation
This commit is contained in:
@@ -158,3 +158,18 @@ std::string Hadrons::dirname(const std::string &s)
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void Hadrons::makeFileDir(const std::string filename, GridBase *g)
|
||||
{
|
||||
if (g->IsBoss())
|
||||
{
|
||||
std::string dir = dirname(filename);
|
||||
int status = mkdir(dir);
|
||||
|
||||
if (status)
|
||||
{
|
||||
HADRONS_ERROR(Io, "cannot create directory '" + dir
|
||||
+ "' ( " + std::strerror(errno) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user