mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add rmDir silent option for all fileOperations implementations
This commit is contained in:
@ -404,7 +404,11 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Removing " << nProcs
|
Info<< "Removing " << nProcs
|
||||||
<< " existing processor directories" << endl;
|
<< " existing processor directories" << endl;
|
||||||
|
|
||||||
fileHandler().rmDir(runTime.path()/word("processors"));
|
fileHandler().rmDir
|
||||||
|
(
|
||||||
|
runTime.path()/word("processors"),
|
||||||
|
true // silent (may not have been collated)
|
||||||
|
);
|
||||||
|
|
||||||
// remove existing processor dirs
|
// remove existing processor dirs
|
||||||
// reverse order to avoid gaps if someone interrupts the process
|
// reverse order to avoid gaps if someone interrupts the process
|
||||||
|
|||||||
@ -247,7 +247,12 @@ public:
|
|||||||
virtual bool rm(const fileName&) const = 0;
|
virtual bool rm(const fileName&) const = 0;
|
||||||
|
|
||||||
//- Remove a dirctory and its contents
|
//- Remove a dirctory and its contents
|
||||||
virtual bool rmDir(const fileName&) const = 0;
|
// \param silent do not report missing directory
|
||||||
|
virtual bool rmDir
|
||||||
|
(
|
||||||
|
const fileName& dir,
|
||||||
|
const bool silent = false
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
// //- Open a shared library. Return handle to library. Print error
|
// //- Open a shared library. Return handle to library. Print error
|
||||||
// // message if library cannot be loaded (check = true)
|
// // message if library cannot be loaded (check = true)
|
||||||
|
|||||||
@ -630,10 +630,11 @@ bool Foam::fileOperations::masterUncollatedFileOperation::rm
|
|||||||
|
|
||||||
bool Foam::fileOperations::masterUncollatedFileOperation::rmDir
|
bool Foam::fileOperations::masterUncollatedFileOperation::rmDir
|
||||||
(
|
(
|
||||||
const fileName& dir
|
const fileName& dir,
|
||||||
|
const bool silent
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return masterOp<bool, rmDirOp>(dir, rmDirOp());
|
return masterOp<bool, rmDirOp>(dir, rmDirOp(silent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -249,10 +249,19 @@ protected:
|
|||||||
|
|
||||||
class rmDirOp
|
class rmDirOp
|
||||||
{
|
{
|
||||||
|
bool silent_;
|
||||||
public:
|
public:
|
||||||
|
rmDirOp()
|
||||||
|
:
|
||||||
|
silent_(false)
|
||||||
|
{}
|
||||||
|
rmDirOp(const bool silent)
|
||||||
|
:
|
||||||
|
silent_(silent)
|
||||||
|
{}
|
||||||
bool operator()(const fileName& fName) const
|
bool operator()(const fileName& fName) const
|
||||||
{
|
{
|
||||||
return Foam::rmDir(fName);
|
return Foam::rmDir(fName, silent_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -533,7 +542,12 @@ public:
|
|||||||
virtual bool rm(const fileName&) const;
|
virtual bool rm(const fileName&) const;
|
||||||
|
|
||||||
//- Remove a dirctory and its contents
|
//- Remove a dirctory and its contents
|
||||||
virtual bool rmDir(const fileName&) const;
|
// \param silent do not report missing directory
|
||||||
|
virtual bool rmDir
|
||||||
|
(
|
||||||
|
const fileName& dir,
|
||||||
|
const bool silent = false
|
||||||
|
) const;
|
||||||
|
|
||||||
// //- Open a shared library. Return handle to library. Print error
|
// //- Open a shared library. Return handle to library. Print error
|
||||||
// // message if library cannot be loaded (check = true)
|
// // message if library cannot be loaded (check = true)
|
||||||
|
|||||||
@ -292,10 +292,11 @@ bool Foam::fileOperations::uncollatedFileOperation::rm
|
|||||||
|
|
||||||
bool Foam::fileOperations::uncollatedFileOperation::rmDir
|
bool Foam::fileOperations::uncollatedFileOperation::rmDir
|
||||||
(
|
(
|
||||||
const fileName& dir
|
const fileName& dir,
|
||||||
|
const bool silent
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return Foam::rmDir(dir);
|
return Foam::rmDir(dir, silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -192,7 +192,11 @@ public:
|
|||||||
virtual bool rm(const fileName&) const;
|
virtual bool rm(const fileName&) const;
|
||||||
|
|
||||||
//- Remove a dirctory and its contents
|
//- Remove a dirctory and its contents
|
||||||
virtual bool rmDir(const fileName&) const;
|
virtual bool rmDir
|
||||||
|
(
|
||||||
|
const fileName& dir,
|
||||||
|
const bool silent = false
|
||||||
|
) const;
|
||||||
|
|
||||||
// //- Open a shared library. Return handle to library. Print error
|
// //- Open a shared library. Return handle to library. Print error
|
||||||
// // message if library cannot be loaded (check = true)
|
// // message if library cannot be loaded (check = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user