def check_md5sums(root=None, failure_cb=_default_failure, progress_cb=None):
    # opens the text file as produced by the md5sum program
    if root is None:
        savedir = root = os.getcwd()
    else:
        savedir = os.getcwd()
        os.chdir(root)
    try:
        try:
            sumfile = SumFile("md5sums.txt")
        except IOError:
            if progress_cb: # verbose...
                print >>sys.stderr, "No md5sums.txt file found in %r" % (os.getcwd(),)
            return # skip directories that don't have an md5sums.txt file
        for chash, mode, fname in sumfile.read_records():
            try:
                disp = compare_md5(fname, chash, mode)
            except IOError, err:
                failure_cb("%s: %s" % (fname, err))
                continue

            if progress_cb:
                progress_cb(fname, disp)
            if not disp:
                failure_cb(fname)
    finally:
        os.chdir(savedir)
dataset/ETHPy150Open kdart/pycopia/core/pycopia/md5lib.py/check_md5sums/original