MCPcopy Index your code
hub / github.com/RustPython/RustPython / cmpfiles

Function cmpfiles

Lib/filecmp.py:265–283  ·  view source on GitHub ↗

Compare common files in two directories. a, b -- directory names common -- list of file names found in both directories shallow -- if true, do comparison based solely on stat() information Returns a tuple of three lists: files that compare equal files that are different

(a, b, common, shallow=True)

Source from the content-addressed store, hash-verified

263
264
265def cmpfiles(a, b, common, shallow=True):
266 """Compare common files in two directories.
267
268 a, b -- directory names
269 common -- list of file names found in both directories
270 shallow -- if true, do comparison based solely on stat() information
271
272 Returns a tuple of three lists:
273 files that compare equal
274 files that are different
275 filenames that aren't regular files.
276
277 """
278 res = ([], [], [])
279 for x in common:
280 ax = os.path.join(a, x)
281 bx = os.path.join(b, x)
282 res[_cmp(ax, bx, shallow)].append(x)
283 return res
284
285
286# Compare two files.

Callers 1

phase3Method · 0.85

Calls 3

_cmpFunction · 0.70
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected