mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: processorMeshes removeFiles does not remove collated (fixes #2607)
ENH: extend rmDir to handle removal of empty directories only - recursively remove directories that only contain other directories but no other contents. Treats dead links as non-content.
This commit is contained in:
@ -98,35 +98,32 @@ Foam::processorFaMeshes::processorFaMeshes
|
||||
|
||||
void Foam::processorFaMeshes::removeFiles(const faMesh& mesh)
|
||||
{
|
||||
IOobject ioAddr
|
||||
IOobject io
|
||||
(
|
||||
"procAddressing",
|
||||
mesh.facesInstance(),
|
||||
faMesh::meshSubDir,
|
||||
mesh.thisDb(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false // not registered
|
||||
mesh.thisDb()
|
||||
);
|
||||
|
||||
// procAddressing
|
||||
rm(ioAddr.objectPath());
|
||||
fileHandler().rm(fileHandler().filePath(io.objectPath()));
|
||||
|
||||
// pointProcAddressing
|
||||
ioAddr.rename("pointProcAddressing");
|
||||
rm(ioAddr.objectPath());
|
||||
io.rename("pointProcAddressing");
|
||||
fileHandler().rm(fileHandler().filePath(io.objectPath()));
|
||||
|
||||
// edgeProcAddressing
|
||||
ioAddr.rename("edgeProcAddressing");
|
||||
rm(ioAddr.objectPath());
|
||||
io.rename("edgeProcAddressing");
|
||||
fileHandler().rm(fileHandler().filePath(io.objectPath()));
|
||||
|
||||
// faceProcAddressing
|
||||
ioAddr.rename("faceProcAddressing");
|
||||
rm(ioAddr.objectPath());
|
||||
io.rename("faceProcAddressing");
|
||||
fileHandler().rm(fileHandler().filePath(io.objectPath()));
|
||||
|
||||
// boundaryProcAddressing
|
||||
ioAddr.rename("boundaryProcAddressing");
|
||||
rm(ioAddr.objectPath());
|
||||
io.rename("boundaryProcAddressing");
|
||||
fileHandler().rm(fileHandler().filePath(io.objectPath()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user