xref: /netbsd-src/external/bsd/file/dist/python/example.py (revision 8450a7c42673d65e3b1f6560d3b6ecd317a6cbe8)
1#! /usr/bin/python
2
3import magic
4
5ms = magic.open(magic.NONE)
6ms.load()
7tp = ms.file("/bin/ls")
8print (tp)
9
10f = open("/bin/ls", "rb")
11buf = f.read(4096)
12f.close()
13
14tp = ms.buffer(buf)
15print (tp)
16
17ms.close()
18