I can successfully call a function with ctypes in Python. Now I have a buffer filled with data structures that I want to retrieve. What is the best strategy for this? What else should I post?
Functions:
class list(): def __init__(self):
Structure:
class dirent(ctypes.Structure): _fields_ = [ ("d_fileno", ctypes.c_uint32), # /* file number of entry */ ("d_reclen", ctypes.c_uint16), # /* length of this record */ ("d_type", ctypes.c_uint8), # /* file type */ ("d_namlen", ctypes.c_uint8), # /* length of string in d_name */ ("d_name", ctypes.c_char * (MAXNAMELEN + 1) ) ]
Some results:
Bytes transmitted: 156
sizeof buffer: 272
Buffer: <ctypes.c_char_Array_272 object at 0x8c3f0>
user191270
source share