RE: Controlling buffer alignment in file.read()

2014-03-18 Thread Haralanov, Mitko
> For control at that level you'd be better off using > direct system calls, i.e. os.open() and os.read(), > then you can read exacty the number of bytes you want. > The problem is not controlling the number of bytes read. That part seems to be working. The issue is that the buffer into which th

Controlling buffer alignment in file.read()

2014-03-18 Thread Haralanov, Mitko
Hi all, I am using Python to read from a binary device file which requires that all read sizes are in 8byte multiples and the user's buffer is 8byte aligned. I am currently using a file object and the file.read() method. However, the issue is that the file.read() method allocates the buffer pas