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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bed2755a22ee69a,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!news-peer-lilac.gradwell.net!not-for-mail From: Rob Norris Newsgroups: comp.lang.ada Subject: Text Processing in Ada 95 Date: Wed, 21 Feb 2007 18:09:09 +0000 Message-ID: X-Newsreader: Forte Free Agent 3.3/32.846 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net NNTP-Posting-Host: 20.133.0.1 X-Trace: 1172081336 news.gradwell.net 757 dnews/20.133.0.1:57947 X-Complaints-To: news-abuse@gradwell.net Xref: g2news2.google.com comp.lang.ada:9375 Date: 2007-02-21T18:09:09+00:00 List-Id: Suppose I have a text file such as: tom dick harry Then I want to insert the line "dave" after tom so the file is tom dave dick harry Also suppose text file can get rather large. Currently I'm using text_io which means I have to copy the whole thing into memory, insert the line then over write the file with new contents. direct_io is not an option (varing string lengths) What alternatives should I consider for making insertions faster? (NB retrieval of a line needs to be fairly quick as well). Thanks in advance.