| 911 | |
| 912 | |
| 913 | bool 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 | |
| 942 | bool Foam::mvBak(const fileName& src, const std::string& ext) |
no test coverage detected