lua-users home
lua-l archive

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


> > Or simply leave it to the garbage collection. (More often than not there
> > is no hurry to close the file.)
> 
> Hmm, until now it bit me twice not doing so (and doing business in C++
> I tend not to close files opened in function scope, leaving the work
> to the destructor).
> 
> Look at the following simple example:
> 
> [...]

I was talking about read-only streams, which is the case of a file
opened by io.lines.

-- Roberto