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,43f3f0c085aeb29d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 24 Apr 2006 19:44:14 +0200 From: Gautier User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Q: Index value in case of Ada.Streams.Stream_IO.End_Error References: <44498820$1_7@news.bluewin.ch> <444ce1c1$1_5@news.bluewin.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.3.54.44 X-Original-NNTP-Posting-Host: 213.3.54.44 Message-ID: <444d0e91$1_5@news.bluewin.ch> X-Trace: news.bluewin.ch 1145900689 213.3.54.44 (24 Apr 2006 19:44:49 +0200) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news2.google.com!news3.google.com!news2.volia.net!solnet.ch!solnet.ch!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:3921 Date: 2006-04-24T19:44:14+02:00 List-Id: Jean-Pierre Rosen: > If you use 'Read, and there is not enough bytes left in the file, then > your file is corrupted. You will get End_Error. > Now, if you want to analyze what happened, here is what you can do: > 1) before calling 'Read, get the current index (function Index) > 2) Do a T'Read > 3) If you get End_Error, do a Set_Index to return where you were, and > use the Read procedure to get the corresponding array of bytes. > Then it's up to you... Fine, it's what I'm doing currently (cf the lines of code in my 1st post). But since the buffer in question happens to be a byte array, I'll switch to the Read procedure and just define the buffer as a Stream_Element_Array. Thanks _______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm