From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6353697ffeb79d16 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 17 Nov 2010 20:21:51 -0600 Date: Wed, 17 Nov 2010 21:21:34 -0500 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Encapsulating Ada.Direct_IO References: <5ba4147a-6099-4a05-b548-09544f58247a@j18g2000yqd.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <162dnSHurcNcEHnRRVn_vwA@giganews.com> X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-fLZK2HWdF3PJl8SwK6jsVEG59f46phPYFyuyK3gggM19vB7f63YNEZwP13ycgKgGb8Ep/gBZ92P+/dz!kkKWj8CKO048mL3cPRfcbhW+6XsMQIPfxGFMMWSYfe0QHXjb547w2gtvYrpWUsg= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1966 Xref: g2news2.google.com comp.lang.ada:16540 Date: 2010-11-17T21:21:34-05:00 List-Id: On 2010-11-17 20:16, Randy Brukardt wrote: > Surely not. Not all machines have 8-bits as any sort of native type. For > instance, the Unisys U2200 (a 36-bit machine, with 9-bit bytes) used > Character'Size = 9. (It was great fun for the cross-compiler.) So in that case if you absolutely wanted to read 8 bit units from a file (because the file is in some externally defined binary format that uses 8 bit units) it would be necessary to do something like: type My_Byte is mod 2**8; for My_Byte'Size use 8; -- This is important. package My_Byte_IO is new Ada.Sequential_IO(My_Byte); ... and then convert from My_Byte to Character only as appropriate during the file decoding process. True? Peter