[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:09:03 +1000
On Wed, Sep 7, 2011 at 9:06 AM, Josh Simmons <email@example.com> wrote:
> On Wed, Sep 7, 2011 at 4:55 AM, Enrico Colombini <firstname.lastname@example.org> 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
The failure is not triggered be errno itself though, so it's possible
for any of the functions to return error but not set errno (on windows