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!d55g2000hsg.googlegroups.com!not-for-mail From: gautier_niouzes@hotmail.com Newsgroups: comp.lang.ada Subject: Re: Concatenating files Date: Thu, 20 Sep 2007 06:11:01 -0700 Organization: http://groups.google.com Message-ID: <1190293861.058191.238500@d55g2000hsg.googlegroups.com> References: <1190237608.187880.115470@o80g2000hse.googlegroups.com> NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1190293861 12706 127.0.0.1 (20 Sep 2007 13:11:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 20 Sep 2007 13:11:01 +0000 (UTC) In-Reply-To: <1190237608.187880.115470@o80g2000hse.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: d55g2000hsg.googlegroups.com; posting-host=206.122.158.4; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2049 Date: 2007-09-20T06:11:01-07:00 List-Id: 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!