[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: file:write() fails silently for read-only files
- From: Josh Simmons <simmons.44@...>
- Date: Tue, 6 Sep 2011 16:51:28 +1000
On Tue, Sep 6, 2011 at 4:39 PM, HyperHacker <email@example.com> wrote:
> Lua 5.1.4 ÂCopyright (C) 1994-2008 Lua.org, PUC-Rio
>> f=io.open('foo.foo', 'r')
> 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.
> Sent from my toaster.
Check the return value of write.