Commit bed8dd4b authored by Henry Weller's avatar Henry Weller Committed by Andrew Heather
Browse files

fileOperation: Corrected processor counting for moving mesh cases

parent fdf08c40
......@@ -392,6 +392,12 @@ int main(int argc, char *argv[])
Info<< "Using existing processor directories" << nl;
}
if (args.optionFound("region"))
{
procDirsProblem = false;
forceOverwrite = false;
}
if (forceOverwrite)
{
Info<< "Removing " << nProcs
......
......@@ -884,6 +884,32 @@ bool Foam::cp(const fileName& src, const fileName& dest, const bool followLink)
return false;
}
char* realSrcPath = realpath(src.c_str(), nullptr);
char* realDestPath = realpath(destFile.c_str(), nullptr);
const bool samePath = strcmp(realSrcPath, realDestPath) == 0;
if (POSIX::debug && samePath)
{
InfoInFunction
<< "Attempt to copy " << realSrcPath << " to itself" << endl;
}
if (realSrcPath)
{
free(realSrcPath);
}
if (realDestPath)
{
free(realDestPath);
}
// Do not copy over self when src is actually a link to dest
if (samePath)
{
return false;
}
// Copy files
fileNameList contents = readDir(src, fileName::FILE, false, followLink);
forAll(contents, i)
......
......@@ -591,14 +591,7 @@ Foam::label Foam::fileOperation::nProcs
label nProcs = 0;
while
(
isDir
(
dir
/(word("processor") + name(nProcs))
/"constant"
/local
/polyMesh::meshSubDir
)
isDir(dir/(word("processor") + name(nProcs)))
)
{
++nProcs;
......
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