mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: robuster fileOperations splitProcessorPath
- robuster matching behaviour when encountering paths that themselves
contain the word "processor" in them. For example,
"/path/processor0generation2/case1/processor10/system"
will now correctly match on processor10 instead of failing.
- use procRangeType for encapsulating the processor ranges
- provision for information of distributed vs non-distributed roots.
The information is currently available from the initial setup, but
can useful to access directly within fileOperation.
STYLE: modernize list iteration
This commit is contained in:
@ -519,29 +519,26 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const fileName& d = dirs[diri];
|
||||
|
||||
// Starts with 'processors'
|
||||
if (d.find("processors") == 0)
|
||||
label proci = -1;
|
||||
|
||||
if
|
||||
(
|
||||
d.starts_with("processor")
|
||||
&&
|
||||
(
|
||||
// Collated is "processors"
|
||||
d[9] == 's'
|
||||
|
||||
// Uncollated has integer(s) after 'processor'
|
||||
|| Foam::read(d.substr(9), proci)
|
||||
)
|
||||
)
|
||||
{
|
||||
if (fileHandler().exists(d))
|
||||
{
|
||||
fileHandler().rmDir(d);
|
||||
}
|
||||
}
|
||||
|
||||
// Starts with 'processor'
|
||||
if (d.find("processor") == 0)
|
||||
{
|
||||
// Check that integer after processor
|
||||
fileName num(d.substr(9));
|
||||
label proci = -1;
|
||||
if (Foam::read(num.c_str(), proci))
|
||||
{
|
||||
if (fileHandler().exists(d))
|
||||
{
|
||||
fileHandler().rmDir(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
procDirsProblem = false;
|
||||
|
||||
Reference in New Issue
Block a user