lua-users home
lua-l archive

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


Roberto,

On Feb 21, 2014, at 13:13 , Roberto Ierusalimschy wrote:

[...] And the ISO C standard paper I found says:

The external representations in a text file need not be identical to the internal representations, and are outside the scope of this International Standard.

NOTHING ELSE! Aside that lines must at least be 254 bytes long:

An implementation shall support text files with lines containing at least 254 characters, including the terminating new-line character. The value of the macro BUFSIZ shall be at least 256.

The official ISO C standard says that too (ISO/IEC 9899:1999 (E), page 263):

 Data read in from a text stream will necessarily compare equal to
 the data that were earlier written out to that stream only if: the
 data consist only of printing characters and the control characters
 horizontal tab and new-line; no new-line character is immediately
 preceded by space characters; and the last character is a new-line
 character.

I thought I made it clear I do not care about this text mode hopefully nobody actually uses:

local f = io.open("Q1-2014.SAP", "rb")

repeat
   local line =  f:read("*l")

?

(This was posted to this discussion many messages ago.)

I am out of this discussion. Too much fact twisting (including about
what I said...)

-- Roberto


-- 
 ExactCODE GmbH, Jaegerstr. 67, DE-10117 Berlin
 http://exactcode.com | http://exactscan.com | http://ocrkit.com | http://t2-project.org | http://rene.rebe.de