lua-users home
lua-l archive

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


On Tue, Aug 25, 2009 at 4:50 PM, David Manura<dm.lua@math2.org> wrote:
> On Mon, Aug 24, 2009 at 9:03 AM, Peter Cawley wrote:
>> Likewise, io.open wraps fopen, and if the
>> underlying C runtime explodes on invalid input, then so will Lua.
>
> I came across that a few weeks ago actually.  io.open(name, 'wa') crashed  [1].
>
> [1] http://luadist.svn.sourceforge.net/viewvc/luadist/trunk/dists/luadist-1.0.0/lmod/dist/log.lua?view=patch&r1=304&r2=303&pathrev=304
>

Is that legal?

I would assumed the documented behaviour on Linux

ERRORS
       EINVAL The mode provided to fopen(), fdopen(), or freopen() was invalid.

Would be the ANSI defined behaviour.

Sam