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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3f045ad8f12bb7f9 X-Google-Attributes: gid103376,public From: johnherro@aol.com Subject: Re: A Text_IO Question Date: 1996/11/11 Message-ID: <19961111132700.IAA28229@ladder01.news.aol.com>#1/1 X-Deja-AN: 195767562 sender: news@aol.com references: <562d9o$hqq@news-e2c.gnn.com> organization: America Online, Inc. (1-800-827-6364) (1.10) newsgroups: comp.lang.ada Date: 1996-11-11T00:00:00+00:00 List-Id: ajaskey@gnn.com (Andy Askey) writes: > The C program writes a ... dummy header to the > top of the file, process a lot of data, ... moves the > file pointer back to the top of the file, and overwrites > the dummy header ... I am just wondering if this is > possible with Text_IO. Unfortunately, no. To achieve random access, you need to instantiate Direct_IO. There are two ways to consider solving your problem. The first is to instantiate Direct_IO for type Character. The effect will depend on the system you're running. Instantiating Direct_IO for type Character works great on a PC, and I've done it several times. On a VAX running VMS, however, you can create a random access file for type Character, but you can't later read it as a plain text file. The file "attributes" are different, and the system remembers that you have a random access file and not a plain text file. DOS doesn't care. The other thing to consider is using memory, if you have enough memory. For example, you might keep the header in memory, and the rest of the data in a temporary file. When you're all ready, write out the (real) header from memory to your final Text_IO file, and then copy data from the temporary file to the final Text_IO file. Finally, delete the temporary file. I hope this helps. - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor