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,c1da643bcd91f37b,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!not-for-mail Newsgroups: comp.lang.ada Subject: Advice on low level file handling. From: "Peter C. Chapin" Organization: Kelsey Mountain Software Message-ID: User-Agent: Xnews/5.04.25 Date: 02 Apr 2006 02:47:17 GMT NNTP-Posting-Host: 5a86bac0.news.sover.net X-Trace: DXC=KWo^Ai66URKb5X7jJYA1FBK6_LM2JZB_Cf0hUJ51TJ>F:WUUlR<856OA I'm working on a program that needs to read an input file on a byte by byte basis and examine bit fields and do bitwise shifting in some of these bytes. Other parts of the file are to be treated as uninterpreted data (this is an OpenPGP message file). Right now I'm using Interfaces.Unsigned_ 8 as the type to hold a single byte from the file and I'm instantiating Ada.Sequential_IO with this type to get the necessary file reading subprograms. So far this seems okay, but I'm wondering if this is the most appropriate way to do this. Am I abusing package Interfaces? Should I be defining my own modular type or should I be using representation clauses with custom record types? Also I need to count the number of bytes I process and the quantity may exceed 2**32. I can define a 64 bit modular type and that seems to work fine on gnat. Is that portable? I'm not extremely worried about portability, but I'd rather not sacrifice it for no reason. Thanks for any advice you can offer. Peter