蛤::插播返回无

时间:2019-04-20 11:01:14

标签: python clam

测试代码

    import clamd
    cd = clamd.ClamdUnixSocket()

    f = '/tmp/EICAR.txt'
    open(f, 'wb').write(clamd.EICAR)
    print(f"Test1: {cd.scan(f)}")

    f = '/tmp/SAFE.txt'
    open(f, 'wb').write(b"asdf")
    print(f"Test2: {cd.scan(f)}")

    from six import BytesIO
    r = cd.instream(BytesIO(clamd.EICAR))
    print(r)

结果

Test1: {'/tmp/EICAR.txt': ('FOUND', 'Eicar-Test-Signature')}
Test2: {'/tmp/SAFE.txt': ('OK', None)}
None

0 个答案:

没有答案