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

Function mv

src/OSspecific/POSIX/POSIX.C:913–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911
912
913bool Foam::mv(const fileName& src, const fileName& dst, const bool followLink)
914{
915 if (POSIX::debug)
916 {
917 //InfoInFunction
918 Pout<< FUNCTION_NAME << " : Move : " << src << " to " << dst << endl;
919 if ((POSIX::debug & 2) && !Pstream::master())
920 {
921 error::printStack(Pout);
922 }
923 }
924
925 if
926 (
927 dst.type() == fileName::DIRECTORY
928 && src.type(followLink) != fileName::DIRECTORY
929 )
930 {
931 const fileName dstName(dst/src.name());
932
933 return ::rename(src.c_str(), dstName.c_str()) == 0;
934 }
935 else
936 {
937 return ::rename(src.c_str(), dst.c_str()) == 0;
938 }
939}
940
941
942bool Foam::mvBak(const fileName& src, const std::string& ext)

Callers 1

updateFileFunction · 0.50

Calls 3

printStackFunction · 0.70
renameFunction · 0.50
typeMethod · 0.45

Tested by

no test coverage detected