From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Problem with Unbounded Strings
Date: Mon, 7 Dec 2015 19:53:09 -0600
Date: 2015-12-07T19:53:09-06:00 [thread overview]
Message-ID: <n45d65$rdj$1@loke.gir.dk> (raw)
In-Reply-To: n3t98j$5pj$1@dont-email.me
"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message
news:n3t98j$5pj$1@dont-email.me...
> On 12/04/2015 04:35 PM, Laurent wrote:
>>
>> Is there no function in the text io libraries to check which line endings
>> are used?
>
> Afraid not. If you're processing files from several platforms, you can
> check for
> and trim off a CR at the end. This will work with files from either
> platform.
It also depends on your vendor's implementation of Text_IO. For Janus/Ada,
we treated LF as the line ending and discard a single CR preceding it (if
one exists). That way, we didn't have to have separate versions of
Text_IO.Get_Line for the different platforms, and it essentially
auto-converts between them. (Of course, Text_IO.Put_Line has to output
different line terminators on the different platforms.) IMHO, this the best
approach for Text_IO, but it does have one drawback...
> However, all bets are off if you might get a file with the old Mac CR line
> terminators. I worked on a system that used the Get_Line function and
> dealt with
> CRs as above since many of the files we processed were produced on Windows
> systems. One day we got a 5-MB file saved with CRs for line terminators.
> Get_Line attempted to read a 5-MB line. That was not pretty.
..and that's it. Doesn't seem worse than any other possibility, though.
Randy.
next prev parent reply other threads:[~2015-12-08 1:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 15:49 Problem with Unbounded Strings Laurent
2015-12-04 16:04 ` Dmitry A. Kazakov
2015-12-04 16:53 ` Laurent
2015-12-04 18:00 ` Niklas Holsti
2015-12-04 21:05 ` Laurent
2015-12-04 20:34 ` Dmitry A. Kazakov
2015-12-04 21:43 ` Laurent
2015-12-04 22:23 ` Dmitry A. Kazakov
2015-12-05 10:22 ` Laurent
2015-12-05 12:19 ` Dmitry A. Kazakov
2015-12-05 13:15 ` Laurent
2015-12-04 18:08 ` Jeffrey R. Carter
2015-12-04 21:21 ` Laurent
2015-12-04 21:59 ` Simon Wright
2015-12-04 23:19 ` Laurent
2015-12-04 22:02 ` Dmitry A. Kazakov
2015-12-04 22:28 ` Jeffrey R. Carter
2015-12-04 23:35 ` Laurent
2015-12-04 23:59 ` Jeffrey R. Carter
2015-12-05 10:13 ` Laurent
2015-12-08 1:53 ` Randy Brukardt [this message]
2015-12-04 23:00 ` Ben Bacarisse
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox