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 16:33:03 +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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.62.10.192 X-Original-NNTP-Posting-Host: 81.62.10.192 Message-ID: <444ce1c1$1_5@news.bluewin.ch> X-Trace: news.bluewin.ch 1145889217 81.62.10.192 (24 Apr 2006 16:33:37 +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!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:3919 Date: 2006-04-24T16:33:03+02:00 List-Id: Jean-Pierre Rosen: >> Is there a RM-documented way to know the Index of a >> Ada.Streams.Stream_IO.File_Type >> when it knocks the end of a file at reading it ? > out parameter Last in function Read... > > This gives you the number of bytes actually read. You mean the _procedure_ Read, from Stream_IO ? procedure Read (File : in File_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); Nice, but for my buffer I need to use the Read _attribute_ (13.13.2). procedure S'Read( Stream : access Ada.Streams.Root_Stream_Type'Class; Item : out T) No "Last" there... If I try: IO_buf'Read( Ada.Streams.Stream_IO.Stream(infile), inbuf, last ); a compiler says as expected: unz_io.adb:55:67: unexpected argument for "Read" attribute Hence my question. Mmmh, unless I redefine my buffer as a Stream_Element_Array. Are you assuming that ? _______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!