lua-users home
lua-l archive

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


On Wed, Dec 17, 2003 at 04:33:47PM -0800, Taj Khattra wrote:
> minor gotcha to beware of if your input fields are not fixed width:
> scanf("%3d") with input string 12x will consume only the first 2
> bytes, whereas file:read(3) will, of course, consume all 3 (and
> therefore tonumber(file:read(3)) will return nil)
> 

definitely worth noting.  actually, in this particular case, i will be
reading in data that the program itself dumped to the disk for later
retrieval. so as long as i write it correctly, i  won't run into this
specific issue. thanks taj,

-p.