[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: file:write() fails silently for read-only files
- From: Josh Simmons <simmons.44@...>
- Date: Wed, 7 Sep 2011 09:06:00 +1000
On Wed, Sep 7, 2011 at 4:55 AM, Enrico Colombini <email@example.com> wrote:
> On 06/09/2011 9.37, steve donovan wrote:
>> Ah, but not always!
>> f = io.open('errio.lua')
>> for i = 1,3 do
>> print(f:write('hello dolly'))
>> On this machine (Windows XP) that write returns true - a silent error!
> That's strange: on my XP, Lua 5.1.2 prints:
> nil No error 0
> Apart from the interesting "No error" error description, it seems to be as
> errio.lua contains five lines.
The third number is the value of errno.
nil, strerror(errno), errno