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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1331b7c1f6d82fa7 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!50g2000hsm.googlegroups.com!not-for-mail From: mhamel_98@yahoo.com Newsgroups: comp.lang.ada Subject: Re: Concatenating files Date: Sat, 22 Sep 2007 10:38:03 -0700 Organization: http://groups.google.com Message-ID: <1190482683.826082.43190@50g2000hsm.googlegroups.com> References: <1190237608.187880.115470@o80g2000hse.googlegroups.com> <1190293861.058191.238500@d55g2000hsg.googlegroups.com> NNTP-Posting-Host: 24.4.68.212 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1190482684 8733 127.0.0.1 (22 Sep 2007 17:38:04 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 22 Sep 2007 17:38:04 +0000 (UTC) In-Reply-To: <1190293861.058191.238500@d55g2000hsg.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 50g2000hsm.googlegroups.com; posting-host=24.4.68.212; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2083 Date: 2007-09-22T10:38:03-07:00 List-Id: 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!