*j) S r SSKrSSKrSSKJr SSKJr / SQr0 rSr / SQr S rSS jrS r S r " S S 5 rSS jr\\4S jrS rS r\S:X a \" 5 gg)zUtilities for comparing files and directories. Classes: dircmp Functions: cmp(f1, f2, shallow=True) -> int cmpfiles(a, b, common) -> ([], [], []) clear_cache() N)filterfalse)GenericAlias)clear_cachecmpdircmpcmpfilesDEFAULT_IGNORESi )RCSCVStagsz.gitz.hgz.bzr_darcs__pycache__c , [ R 5 g)zClear the filecmp cache.N)_cacheclear ./opt/alt/python313/lib64/python3.13/filecmp.pyr r s LLNr c [ [ R " U 5 5 n[ [ R " U5 5 nUS [ R :w d US [ R :w a gU( a X4:X a gUS US :w a g[ R XX445 nUc3 [ X5 n[ [ 5 S: a [ 5 U[ XX44' U$ )a 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(). r FT d ) _sigosstatS_IFREGr get_do_cmplenr )f1f2shallows1s2outcomes r r r s . bggbk B bggbk B !u1 528 !u1~jj"")*G"/v;M!(rr~Nr c p [ R " U R 5 U R U R 4$ N)r S_IFMTst_modest_sizest_mtime)sts r r r F s* KK #JJKK r c B [ n[ U S5 n[ US5 n UR U5 nUR U5 nXV:w a S S S 5 S S S 5 gU( d S S S 5 S S S 5 gMT ! , ( d f O= fS S S 5 g ! , ( d f g = f)NrbTF)BUFSIZEopenread)r r bufsizefp1fp2b1b2s r r r K so G b$3R#'"B'"Bx !/ !/ !/s4 B*A6 BA6#B4A66 B B Bc \ rS rSrSrSSS.S jjrS rS rS rS r S r S rS rS r S r\" \ \ \ \ \\\\\\\\S9rS r\" \5 rSrg)r X a A class that manages the comparison of 2 directories. dircmp(a, b, ignore=None, hide=None, *, shallow=True) A and B are directories. IGNORE is a list of names to ignore, defaults to DEFAULT_IGNORES. HIDE is a list of names to hide, defaults to [os.curdir, os.pardir]. SHALLOW specifies whether to just check the stat signature (do not read the files). defaults to True. High level usage: x = dircmp(dir1, dir2) x.report() -> prints a report on the differences between dir1 and dir2 or x.report_partial_closure() -> prints report on differences between dir1 and dir2, and reports on common immediate subdirectories. x.report_full_closure() -> like report_partial_closure, but fully recursive. Attributes: left_list, right_list: The files in dir1 and dir2, filtered by hide and ignore. common: a list of names in both dir1 and dir2. left_only, right_only: names only in dir1, dir2. common_dirs: subdirectories in both dir1 and dir2. common_files: files in both dir1 and dir2. common_funny: names in both dir1 and dir2 where the type differs between dir1 and dir2, or the name is not stat-able. same_files: list of identical files. diff_files: list of filenames which differ. funny_files: list of files which could not be compared. subdirs: a dictionary of dircmp instances (or MyDirCmp instances if this object is of type MyDirCmp, a subclass of dircmp), keyed by names in common_dirs. NTr! c Xl X l Uc&