diff options
Diffstat (limited to 'external/bsd/file/dist/python/example.py')
| -rw-r--r-- | external/bsd/file/dist/python/example.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/external/bsd/file/dist/python/example.py b/external/bsd/file/dist/python/example.py index fc41a86d7ed..0cd0b5e7ec2 100644 --- a/external/bsd/file/dist/python/example.py +++ b/external/bsd/file/dist/python/example.py @@ -1,16 +1,17 @@ +#! /usr/bin/python + import magic -ms = magic.open(magic.MAGIC_NONE) +ms = magic.open(magic.NONE) ms.load() -type = ms.file("/path/to/some/file") -print type +tp = ms.file("/bin/ls") +print (tp) -f = file("/path/to/some/file", "r") -buffer = f.read(4096) +f = open("/bin/ls", "rb") +buf = f.read(4096) f.close() -type = ms.buffer(buffer) -print type +tp = ms.buffer(buf) +print (tp) ms.close() - |
