Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #68524
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Controlling buffer alignment in file.read() |
| Date | 2014-03-19 12:08 +1300 |
| Message-ID | <bos1vgF8r6oU1@mid.individual.net> (permalink) |
| References | <mailman.8260.1395174272.18130.python-list@python.org> |
Haralanov, Mitko wrote: > 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. > > Is there a way that I can get file.read() to use an 8byte aligned buffer? 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. -- Greg
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Controlling buffer alignment in file.read() "Haralanov, Mitko" <mitko.haralanov@intel.com> - 2014-03-18 20:23 +0000
Re: Controlling buffer alignment in file.read() Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-19 12:08 +1300
RE: Controlling buffer alignment in file.read() "Haralanov, Mitko" <mitko.haralanov@intel.com> - 2014-03-18 23:13 +0000
Re: Controlling buffer alignment in file.read() Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-19 13:07 +1300
RE: Controlling buffer alignment in file.read() Laurent Pointal <laurent.pointal@free.fr> - 2014-03-22 19:28 +0100
csiph-web