acbs_src_process.py 文件源码

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

项目:acbs 作者: AOSC-Dev 项目源码 文件源码
def file_type(file_loc):
    try:
        import magic
    except:
        print('[W] ACBS cannot find libmagic bindings, will use bundled one instead.')
        import lib.magic as magic
    mco = magic.open(magic.MIME_TYPE | magic.MAGIC_SYMLINK)
    mco.load()
    try:
        tp = mco.file(file_loc)
        tp_list = tp.decode('utf-8').split('/')
    except:
        print('[W] Unable to determine the file type!')
        return ['unknown', 'unknown']
    return tp_list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号