From: Gautier <gautier@fakeaddress.nil>
Subject: Re: Q: Index value in case of Ada.Streams.Stream_IO.End_Error
Date: Mon, 24 Apr 2006 16:33:03 +0200
Date: 2006-04-24T16:33:03+02:00 [thread overview]
Message-ID: <444ce1c1$1_5@news.bluewin.ch> (raw)
In-Reply-To: <s71i2e.oa9.ln@hunter.axlog.fr>
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!
next prev parent reply other threads:[~2006-04-24 14:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-22 1:33 Q: Index value in case of Ada.Streams.Stream_IO.End_Error Gautier
2006-04-24 8:11 ` Jean-Pierre Rosen
2006-04-24 14:33 ` Gautier [this message]
2006-04-24 16:05 ` Jean-Pierre Rosen
2006-04-24 17:44 ` Gautier
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox