[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: io:lines() and \0
- From: Francisco Olarte <folarte@...>
- Date: Wed, 19 Feb 2014 10:34:50 +0100
On Wed, Feb 19, 2014 at 8:53 AM, Tim Hill <email@example.com> wrote:
> OK except my reading of the ANSI text is that reading lines is *not* guaranteed to work if the newline is preceded by spaces, i.e. it may fail if the line has trailing whitespace. Which is the opposite of allowing for fixed-wdith punched cards.
Do not exactly remember the text, but what I was trying to say is some
systems do NOT use newline chars, they use fixed lentgh records, space
padded, and the runtime has to syntetize the newline, or they have a
syntetic newline at some other position. Anyway, you normally do not
have to worry about this if you use any of the mainline operating
> Now, I very much doubt if any real-world C runtime would behave like that, but it is a bit odd.
Not any modern one, as presently nearly every OS treats files as a
byte array, but once you throw exotic device streams and legacy OS
into the mix, I'm not so sure. Backwards compatibiity is a bitch.