summaryrefslogtreecommitdiff
path: root/portato/eix/libeix.pyx
blob: 2b3ebb0088a91bc4ade8d922876f317f07a011d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from portato.eix.eix_utils cimport File, fopen, fclose, ffree, fget

def test (f):
    cdef File* cf
    cdef char* buf

    print "Trying to open: ", f
    cf = fopen(f, "r")
    try:
        buf = fget(cf, 20)
        print "The first two chars:", buf[0], buf[1]
        ffree(buf)
    finally:
        fclose(cf)