comp.lang.ada
 help / color / mirror / Atom feed
From: mhamel_98@yahoo.com
Subject: Re: Concatenating files
Date: Sat, 22 Sep 2007 10:38:03 -0700
Date: 2007-09-22T10:38:03-07:00	[thread overview]
Message-ID: <1190482683.826082.43190@50g2000hsm.googlegroups.com> (raw)
In-Reply-To: <1190293861.058191.238500@d55g2000hsg.googlegroups.com>

Thanks for the replies!  How about this, instantiating Sequential_Io
with a variant record?  The header data can be put into a record
easily enough, so I would write the first sequential record as a
header type with the following as the original data records.  The
problem is, some of the header data will not be known until all the
data records have been written.  Is there a way to edit, in place, the
first record of a sequential file?  Thanks much again c.l.a!

On Sep 20, 6:11 am, gautier_niou...@hotmail.com wrote:
> On 19 Sep., 23:33, mhamel...@yahoo.com wrote:
>
> > Hello c.l.a.  I have a storage system for a program of mine that uses
> > two files for each object - a text header file via text_io and a data
> > file via sequential_io.  I am wondering if there is an elegant way to
> > put the contents of these two files into one.  The textual header bit
> > is fixed size/length.  Any ideas?  ObjectAda 95 on NT.
>
> Do you also need to keep both files separately ?
> If no, you can use the Append_File mode when writing the binary data
> immediately at the end of the first one.
> If yes, I would prefer a straightforward way which doesn't use much
> memory even if the files are big: use Sequential_IO to read Size(T)
> bytes
> of the text file T and write into mixed file M, then read Size(D)
> bytes
> of the data file D and write them into M.
> It's portable, endian-proof, etc. ...
> ______________________________________________________________
> 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!





  reply	other threads:[~2007-09-22 17:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 21:33 Concatenating files mhamel_98
2007-09-20  4:28 ` Jeffrey R. Carter
2007-09-20 11:41 ` Jacob Sparre Andersen
2007-09-20 13:11 ` gautier_niouzes
2007-09-22 17:38   ` mhamel_98 [this message]
2007-09-22 20:07     ` Jeffrey R. Carter
2007-09-22 22:51       ` mhamel_98
2007-09-23  1:45         ` Jeffrey R. Carter
replies disabled

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