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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Text IO for files not using the standard line termination for the OS Date: Sun, 18 Nov 2018 10:26:29 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <93200914-ef2d-4cb1-8b45-76819db2a8e0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 18 Nov 2018 09:26:30 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="98730f0045db0eceea280806e0b7d89a"; logging-data="21689"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GQVu7E6wUU8hObQPJrxbNRC+0fcFxzwo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cancel-Lock: sha1:KsCneOz5k4xqku8PXA+Wf7Eyxz8= In-Reply-To: <93200914-ef2d-4cb1-8b45-76819db2a8e0@googlegroups.com> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:54840 Date: 2018-11-18T10:26:29+01:00 List-Id: On 11/18/18 4:44 AM, Shark8 wrote: > > I think you have to do it character-by-character in this case. > There's a library called PragmaARC (IIRC) that has Text_IO packages for non-native text, you might want to take a look there. These are the PragmAda Reusable Components. Package PragmARC.Text_IO handles files with 3 kinds of line terminators: type EOL_ID is (DOS_Windows_EOL, Mac_EOL, Unix_EOL); -- Used to specify what line terminator to use on output -- DOS_Windows_EOL = CR-LF -- Mac_EOL = CR -- Unix_EOL = LF For reading, it automatically handles EOLs of all 3 kinds, which may be mixed in the same file (though I've never encountered this). For output, when the files is created/opened, the desired EOL kind is specified. The PragmARCs are at https://github.com/jrcarter/PragmARC HTH -- Jeff Carter "Ditto, you provincial putz?" Blazing Saddles 86