lua-users home
lua-l archive

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

On Mon, Nov 21, 2005 at 12:51:25PM -0200, Roberto Ierusalimschy wrote:
> > This means that code like this (from luasocket)
> > 
>  > a,b,c= h.request{url="",sink=
> > ltn12.sink.file(io.stdout)}
> > 
> > will close stdout in 5.1 whereas in 5.0.2 it did not.
> I may be wrong, but I think a library function should not close a file
> that it did not open.
It is common and handy for such wrappers to be able to
finally close their files, as they usually have the only
reference, and file close should not be deferred to the gc.

> > Would it be possible to have [...] an io flag that sets the old behaviour?
But probably the wrapper should have such a flag.