MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / filesEqual

Function filesEqual

programs/install/Install.cpp:129–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129static 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
139static void changeOwnership(const String & file_name, const String & user_name, const String & group_name = {}, bool recursive = true)
140{

Callers 1

Install.cppFile · 0.85

Calls 3

sizeMethod · 0.45
bufferMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected