lua-users home
lua-l archive

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


> Mostly for data containers (vectors, matrices of numbers) the typical code for 
> writing data to files is:
> 
> local f = assert(io.open("somefile.txt", "w"))
> -- follows asserted code where I write the elements of the container to f
> f:close()

Just a detail: IIRC, you do not need to assert the 'write's. Any wrong
'write' will cause 'f:close' to fail, so you only need to assert
the 'open' and the 'close'.

-- Roberto