Haralanov, Mitko wrote:

The problem is not controlling the number of bytes read. That part seems to
be working. The issue is that the buffer into which the data is placed needs
to be of certain alignment (8byte-aligned). Python does not seem to have a
way that allows me to control that.

Hmmm, that could be tricky. Have you tried using os.read()?
If you're lucky, Python will be using a malloc() call or
equivalent to create a str/bytes object to read the data
into, and that will return something platform-aligned.

If you're unlucky, there's probably no pure-Python
solution, and you might need to write a small C or
Cython module to accomplish this trick.


--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to