MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / rm

Function rm

src/OSspecific/POSIX/POSIX.C:984–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

982
983
984bool Foam::rm(const fileName& file)
985{
986 if (POSIX::debug)
987 {
988 //InfoInFunction
989 Pout<< FUNCTION_NAME << " : Removing : " << file << endl;
990 if ((POSIX::debug & 2) && !Pstream::master())
991 {
992 error::printStack(Pout);
993 }
994 }
995
996 // Try returning plain file name; if not there, try with .gz
997 if (remove(file.c_str()) == 0)
998 {
999 return true;
1000 }
1001 else
1002 {
1003 return ::remove(string(file + ".gz").c_str()) == 0;
1004 }
1005}
1006
1007
1008bool Foam::rmDir(const fileName& directory)

Callers 7

rmDirFunction · 0.70
mainFunction · 0.50
objectsFunction · 0.50
objectsFunction · 0.50
rmFilesFunction · 0.50
removeFilesFunction · 0.50

Calls 3

printStackFunction · 0.70
stringClass · 0.70
removeFunction · 0.50

Tested by

no test coverage detected