comp.lang.ada
 help / color / mirror / Atom feed
From: "Francis Crick" <fcrNOSPAMick@fas.harvard.edu>
Subject: Re: implementation question about writing and reading from files
Date: Thu, 9 Aug 2001 16:19:39 -0700
Date: 2001-08-09T16:19:39-07:00	[thread overview]
Message-ID: <9kv5rs$6hosn$2@ID-102190.news.dfncis.de> (raw)
In-Reply-To: j_jb7.33402$Kd7.20784576@news1.rdc1.sfba.home.com

I'm still really confused about these calls...anyone willing to offer me
some extra help?

I've been playing around with these calls but i really don't understand what
the parameters mean...obviously File_Type is the file i'm getting, but what
about the Item and Last parameters?  Is Stream_Element a generic type I have
to declare, and if so, how and where do I do that?  If not, how can I ensure
I'm getting the ammount of data out of the file that I want on any platform?

The From param in Read - what does this represent exactly?  from byte #?
from Stream_Element # in the stream?

And also, if I want to use a stream for keeping data in memory, how do i
that?  How do i instantiate a stream that I can just write to and read from
at my leisure?  Also, the data I'm moving is large, and chances are I won't
be using it for much else other than writing back to other file streams, so
how can i make the reading and writing as fast as possible?  Could I make it
read a whole mb in one go as a single unit?

Sorry most of these are no-brainers...I'm still a total Ada newbie and I
haven't really got a grasp of the way things work yet...

TIA!

Francis Crick

<tmoran@acm.org> wrote in message
news:j_jb7.33402$Kd7.20784576@news1.rdc1.sfba.home.com...
>   I'd suggest Ada.Streams.Stream_IO
>
> > read a chunk of any size from any part of a file and write it into
memory
> > and pass back the pointer.
>     procedure Read (File : in     File_Type;
>                     Item :    out Stream_Element_Array;
>                     Last :    out Stream_Element_Offset;
>                     From : in     Positive_Count);
>
> > write a chunk of any size into any part of any file.
>   assuming "any file" does not include, for instance, printer output,
>     procedure Write(File : in     File_Type;
>                     Item : in     Stream_Element_Array;
>                     From : in     Positive_Count);









  reply	other threads:[~2001-08-09 23:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-05 22:18 implementation question about writing and reading from files Francis Crick
2001-08-05 22:43 ` tmoran
2001-08-09 23:19   ` Francis Crick [this message]
2001-08-10  0:55     ` tmoran
2001-08-10 14:49     ` Ted Dennison
2001-08-10 15:44       ` Warren W. Gay VE3WWG
2001-08-06 16:03 ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox