[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (beta-rc2) now available
- From: steve donovan <steve.j.donovan@...>
- Date: Wed, 22 Jun 2011 11:06:29 +0200
On Wed, Jun 22, 2011 at 10:52 AM, Jerome Vuarand
> The API of the file objects is clearly defined in the manual, you can
> implement a new function io.open that would return your own userdata
> (or a table) with the right methods.
This is true, and it's the approach I took for a SciTE extension that
needed a robust popen. But it involves copying most of liolib.c, which
seems like overkill. The suggested io.fdopen() would allow you to
pass your own open file handle (with an optional cleanup function?)
and let the existing io functionality do the rest.
As for undocumented, well this is exactly the point: continuing to
cast to FILE** can be a problem.