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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!news.musoftware.de!wum.musoftware.de!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Encapsulating Ada.Direct_IO Date: Thu, 18 Nov 2010 12:45:39 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <5ba4147a-6099-4a05-b548-09544f58247a@j18g2000yqd.googlegroups.com> <8bb3a7c0-c473-4c35-bc6e-3920ce80e6a8@q36g2000vbi.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1290105940 30317 69.95.181.76 (18 Nov 2010 18:45:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 18 Nov 2010 18:45:40 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Xref: g2news1.google.com comp.lang.ada:15595 Date: 2010-11-18T12:45:39-06:00 List-Id: "Adam Beneschan" wrote in message news:8bb3a7c0-c473-4c35-bc6e-3920ce80e6a8@q36g2000vbi.googlegroups.com... ... >I did notice, though, that Peter was talking about how data was stored >in a *file*. In the Unisys U2200 system, how were files kept, >conceptually? Were they streams of 8-bit bytes, or were they stored >as 36-bit words or 9-bit bytes or what? I'd assume that for a text >file, when you read it in, four bytes would be stored in each word and >the high bit of each 9-bit byte would be zeroed---whether that zero >bit was actually stored on disk or not should be the OS's concern, not >the program's, and I'd presume that the OS would also have to handle >things correctly when text files are transferred from a different >machine. It stored text as streams of 9-bit characters. We were running on a Unix emulator, and there were a bunch of conversions when you communicated to the "normal" 8-bit world. When you think of it, it is amazing that they could get Unix code to run in such an environment. Just imagine all of the things C could do that would assume 8-bits. Us Ada people had it easy: the language was designed to allow use on such machines (although I think there were only a few such compilers built). We only ran into one language bug (for modular types) having to do with 1's complement math. Perhaps this is all OBE these days, and Ada could be simplified and assume 8-bit only. But I doubt it would make that much difference, so it probably wouldn't be worth the effort. Randy. What I'm leading up to, though, is that I think Peter's question is too simple. We're all spoiled in having to deal exclusively, or almost exclusively, with machines with 8-bit byte addressability and files that are unstructured sequences of 8-bit bytes. But there are other systems out there. There are machines in use that are not byte- addressable---Analog Devices 21060 series comes to mind, which uses 32- bit words whose bytes are not individually addressable. When reading from a file on that system, do you want each word to hold one byte, or four? Even in VAX/VMS, which does run on a machine with 8-bit byte addressibility, the OS is able to create files that have more structure than just being sequences of bytes. What would it mean to instantiate Direct_IO(Character) on a file like that? I don't think the answer is trivial. How did the Pick operating system treat files conceptually? How would Direct_IO work on one of that system's files? Ada's designers have tried to design a language that could work on any of those systems, and therefore I think the standard does not and cannot answer Peter's question. In fact, I'm not entirely sure that his question is meaningful on platforms that don't use 8-bit bytes and/ or use files with some structure. (It might have to be rephrased.) In any event, I think that details like this are left up to the implementation. And if you were trying to do something like this on a U2200, there is no Ada answer to the question, because you would have to know more about the particular OS's file system and how the Ada implementation interacts with it. -- Adam