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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,136a2b49b817b53c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-26 06:56:04 PST Path: supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!nntp.news.xara.net!xara.net!gxn.net!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada References: Subject: Re: Binary Data File - PLEASE HELP X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <%FIv6.31761$Q4.5539631@news2-win.server.ntlworld.com> Date: Mon, 26 Mar 2001 15:49:39 +0100 NNTP-Posting-Host: 62.252.136.192 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 985618171 62.252.136.192 (Mon, 26 Mar 2001 15:49:31 BST) NNTP-Posting-Date: Mon, 26 Mar 2001 15:49:31 BST Organization: ntlworld News Service Xref: supernews.google.com comp.lang.ada:6051 Date: 2001-03-26T15:49:39+01:00 List-Id: Try using Direct_IO instantiated for type Char, or a mod 'byte' type i.e. type byte is mod 256; then write a procedure -- read a sequence of bytes upto numb, from file; -- if reaches EOF first raise exception EOF_Error; -- procedure fread (file : in File_Type; bytes : out byte_array_type; numb : in Natural); the procedure simply uses a while loop or a for loop to read from the file numb times. -- though i'm not sure how to get an unconstrained array to work for this; type byte_array_type is array(natural range <>) of byte; would be ok, but it might not work with the above procedure. Someone else will have to help you with that. I'd be interested to get any number of bytes out in an unconstrained type. Anyone know how? Chris Campbell