mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
foamListTimes: Added '-rm' option to remove the selected time directories
If -rm is specified with the -processor option the selected time directories are removed from all the processor directories.
This commit is contained in:
@ -31,6 +31,8 @@ Usage
|
||||
|
||||
- foamListTimes [OPTION]
|
||||
|
||||
\param -rm \n
|
||||
Remove selected time directories
|
||||
\param -processor \n
|
||||
List times from processor0/ directory
|
||||
|
||||
@ -56,6 +58,11 @@ int main(int argc, char *argv[])
|
||||
"processor",
|
||||
"list times from processor0/ directory"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"rm",
|
||||
"remove selected time directories"
|
||||
);
|
||||
#include "setRootCase.H"
|
||||
|
||||
label nProcs = 0;
|
||||
@ -117,9 +124,37 @@ int main(int argc, char *argv[])
|
||||
args
|
||||
);
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
if (args.optionFound("rm"))
|
||||
{
|
||||
Info<< timeDirs[timeI].name() << endl;
|
||||
if (args.optionFound("processor"))
|
||||
{
|
||||
for (label procI=0; procI<nProcs; procI++)
|
||||
{
|
||||
fileName procPath
|
||||
(
|
||||
args.path()/(word("processor") + name(procI))
|
||||
);
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
rmDir(procPath/timeDirs[timeI].name());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
rmDir(args.path()/timeDirs[timeI].name());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
Info<< timeDirs[timeI].name() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user