| 127 | } |
| 128 | |
| 129 | static bool filesEqual(std::string path1, std::string path2) |
| 130 | { |
| 131 | MMapReadBufferFromFile in1(path1, 0); |
| 132 | MMapReadBufferFromFile in2(path2, 0); |
| 133 | |
| 134 | /// memcmp is faster than hashing and comparing hashes |
| 135 | return in1.buffer().size() == in2.buffer().size() |
| 136 | && 0 == memcmp(in1.buffer().begin(), in2.buffer().begin(), in1.buffer().size()); |
| 137 | } |
| 138 | |
| 139 | static void changeOwnership(const String & file_name, const String & user_name, const String & group_name = {}, bool recursive = true) |
| 140 | { |
no test coverage detected