[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: file:write() fails silently for read-only files
- From: startx <startx@...>
- Date: Tue, 6 Sep 2011 08:10:20 +0100
On Tue, 6 Sep 2011 00:39:00 -0600
HyperHacker <hyperhacker@gmail.com> wrote:
> Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> > f=io.open('foo.foo', 'r')
> > f:write('ffd')
> > f:close()
> >
>
> Call me crazy, but I feel like f:write() should throw an error when
> trying to write to a read-only file, instead of just doing nothing.
>
hm, when i do that ( on linux ) i _do_ get an error
lua: filer.lua:2: attempt to index global 'f' (a nil value)
stack traceback:
filer.lua:2: in main chunk
[C]: ?
startx