Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'read.': 0.03; 'alignment': 0.07; 'subject:()': 0.09; 'python': 0.11; 'thanks,': 0.17; 'working.': 0.19; 'seems': 0.21; 'to:name:python-list@python.org': 0.22; 'bytes': 0.24; 'controlling': 0.24; 'certain': 0.27; 'header :In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'that.': 0.31; 'allows': 0.31; 'received:169.254': 0.32; 'problem': 0.35; 'i.e.': 0.36; 'charset:us-ascii': 0.36; 'received:169': 0.37; 'level': 0.37; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'read': 0.60; 'direct': 0.67; 'calls,': 0.84 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,681,1389772800"; d="scan'208";a="501559693" From: "Haralanov, Mitko" To: Gregory Ewing , "python-list@python.org" Subject: RE: Controlling buffer alignment in file.read() Thread-Topic: Controlling buffer alignment in file.read() Thread-Index: AQHPQv75EIEp9ebFTROzTNrUEcEfy5rnePNw Date: Tue, 18 Mar 2014 23:13:46 +0000 References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395184430 news.xs4all.nl 2967 [2001:888:2000:d::a6]:59082 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68526 > 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. >=20 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 c= ertain alignment (8byte-aligned). Python does not seem to have a way that a= llows me to control that. Thanks, - Mitko