| 870 | |
| 871 | |
| 872 | bool Foam::ln(const fileName& src, const fileName& dst) |
| 873 | { |
| 874 | if (POSIX::debug) |
| 875 | { |
| 876 | //InfoInFunction |
| 877 | Pout<< FUNCTION_NAME |
| 878 | << " : Create softlink from : " << src << " to " << dst << endl; |
| 879 | if ((POSIX::debug & 2) && !Pstream::master()) |
| 880 | { |
| 881 | error::printStack(Pout); |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | if (exists(dst)) |
| 886 | { |
| 887 | WarningInFunction |
| 888 | << "destination " << dst << " already exists. Not linking." |
| 889 | << endl; |
| 890 | return false; |
| 891 | } |
| 892 | |
| 893 | if (src.isAbsolute() && !exists(src)) |
| 894 | { |
| 895 | WarningInFunction |
| 896 | << "source " << src << " does not exist." << endl; |
| 897 | return false; |
| 898 | } |
| 899 | |
| 900 | if (::symlink(src.c_str(), dst.c_str()) == 0) |
| 901 | { |
| 902 | return true; |
| 903 | } |
| 904 | else |
| 905 | { |
| 906 | WarningInFunction |
| 907 | << "symlink from " << src << " to " << dst << " failed." << endl; |
| 908 | return false; |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | |
| 913 | bool Foam::mv(const fileName& src, const fileName& dst, const bool followLink) |
no test coverage detected