lua-users home
lua-l archive

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


> Reading between the lines, the standard is pretty clear that
> continuing to operate on a FILE after calling fclose() is not
> valid. Effectively, continued use of a FILE* after calling
> fclose() is similar to continued use a malloc()ed pointer after
> calling free(). You might get lucky, but that doesn't make it valid.

That is true. Perhaps the best solution to all these problems would be
to prohibit Lua from closing a standard file (stdin/stdout/stderr).
Older versions of Lua had this restriction, I cannot remember why
we lifted it.

-- Roberto