find-duplicates.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:calm 作者: cygwin 项目源码 文件源码
def read_tar(f):
    result = {}

    try:
        with tarfile.open(f) as t:
            for m in t:
                if m.isfile():
                    f = t.extractfile(m)
                    sha512 = sha512_file(f)
                else:
                    sha512 = None
                result[m.name] = TarMemberInfo(m, sha512)
    except tarfile.ReadError:
        # if we can't read the tar archive, we should never consider it to have
        # the same contents as another tar archive...
        result[f] = None

    return result

#
#
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号