lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi:

On Wed, Feb 19, 2014 at 8:53 AM, Tim Hill <drtimhill@gmail.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
systems.

> 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.

Francisco Olarte.