MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / UtilCreateDirectoryDestructive

Method UtilCreateDirectoryDestructive

Src/Base/AMReX_Utility.cpp:195–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193
194
195void
196amrex::UtilCreateDirectoryDestructive(const std::string &path, bool callbarrier)
197{
198 BL_PROFILE("UtilCreateDirectoryDestructive()")
199 if(ParallelContext::IOProcessorSub())
200 {
201 if(amrex::FileExists(path))
202 {
203 if (amrex::Verbose() > 1) {
204 amrex::Print() << "amrex::UtilCreateCleanDirectoryDestructive(): " << path
205 << " exists. I am destroying it. " << '\n';
206 }
207 FileSystem::RemoveAll(path);
208 }
209 if( ! amrex::UtilCreateDirectory(path, 0755))
210 {
211 amrex::CreateDirectoryFailed(path);
212 }
213 }
214 if(callbarrier)
215 {
216 // Force other processors to wait until directory is built.
217 ParallelDescriptor::Barrier("amrex::UtilCreateCleanDirectoryDestructive");
218 }
219}
220
221void
222amrex::UtilRenameDirectoryToOld (const std::string &path, bool callbarrier)

Callers

nothing calls this directly

Calls 4

IOProcessorSubFunction · 0.85
PrintClass · 0.85
RemoveAllFunction · 0.85
BarrierFunction · 0.85

Tested by

no test coverage detected