PyDocs

Nav

File and Directory Access

cmp

filecmp

function (source)
  • cmp(f1, f2, shallow=True)
Compare two files.

Arguments:

f1 -- First file name

f2 -- Second file name

shallow -- treat files as identical if their stat signatures (type, size,
           mtime) are identical. Otherwise, files are considered different
           if their sizes or contents differ.  [default: True]

Return value:

True if the files are the same, False otherwise.

This function uses a cache for past comparisons and the results,
with cache entries invalidated if their stat information
changes.  The cache may be cleared by calling clear_cache().
0 Examples
No examples for filecmp/cmp.
See Also
No see-alsos for filecmp/cmp
0 Notes
No notes for cmp