repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Expand PMF_FN_* macros.
[netbsd-mini2440.git]
/
external
/
bsd
/
file
/
dist
/
python
/
example.py
blob
fc41a86d7ed7bad82bc85f5204dd88e502708892
1
import
magic
2
3
ms
=
magic
.
open
(
magic
.
MAGIC_NONE
)
4
ms
.
load
()
5
type
=
ms
.
file
(
"/path/to/some/file"
)
6
print
type
7
8
f
=
file
(
"/path/to/some/file"
,
"r"
)
9
buffer
=
f
.
read
(
4096
)
10
f
.
close
()
11
12
type
=
ms
.
buffer
(
buffer
)
13
print
type
14
15
ms
.
close
()
16