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
评论列表
文章目录