def is_archive(path):
    """checks if path points to an archive"""
    if not is_mounted(path):
        arch = False
        try:
            arch = tarfile.is_tarfile(path)
        except:
            # not found
            pass
        try:
            arch = (arch or zipfile.is_zipfile(path))
        except:
            pass
        return arch
    else:
        fe = get_file_extension(path)
        if fe in ("zip", "rar", "tar", "bz2", "gz"):
            return True
        else:
            return False
checks if path points to an archive
bin/ls.py