Permalink
Browse files

foamListTimes: Added '-rm' option to remove the selected time directo…

…ries

If -rm is specified with the -processor option the selected time
directories are removed from all the processor directories.
  • Loading branch information...
Henry Henry
Henry authored and Henry committed May 8, 2015
1 parent c9d9ba0 commit 227f3a33f5f9d2ff9e570aa7a6c3473e0643ad24
Showing with 37 additions and 2 deletions.
  1. +37 −2 applications/utilities/postProcessing/miscellaneous/foamListTimes/foamListTimes.C
@@ -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;

0 comments on commit 227f3a3

Please sign in to comment.