MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / cmpfiles

Function cmpfiles

tools/python-3.11.9-amd64/Lib/filecmp.py:258–276  ·  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 d

(a, b, common, shallow=True)

Source from the content-addressed store, hash-verified

256
257
258def cmpfiles(a, b, common, shallow=True):
259 """Compare common files in two directories.
260
261 a, b -- directory names
262 common -- list of file names found in both directories
263 shallow -- if true, do comparison based solely on stat() information
264
265 Returns a tuple of three lists:
266 files that compare equal
267 files that are different
268 filenames that aren't regular files.
269
270 """
271 res = ([], [], [])
272 for x in common:
273 ax = os.path.join(a, x)
274 bx = os.path.join(b, x)
275 res[_cmp(ax, bx, shallow)].append(x)
276 return res
277
278
279# 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