comp.lang.ada
 help / color / mirror / Atom feed
From: gautier_niouzes@hotmail.com
Subject: Re: Concatenating files
Date: Thu, 20 Sep 2007 06:11:01 -0700
Date: 2007-09-20T06:11:01-07:00	[thread overview]
Message-ID: <1190293861.058191.238500@d55g2000hsg.googlegroups.com> (raw)
In-Reply-To: <1190237608.187880.115470@o80g2000hse.googlegroups.com>

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!




  parent reply	other threads:[~2007-09-20 13:11 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 [this message]
2007-09-22 17:38   ` mhamel_98
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