[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: file:write() fails silently for read-only files
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 6 Sep 2011 09:37:14 +0200
On Tue, Sep 6, 2011 at 9:21 AM, startx <email@example.com> wrote:
> f = io.open('foo.foo', 'r')
> success = f:write('ffd')
> success will be NIL if the file cannot be written to.
Ah, but not always!
f = io.open('errio.lua')
for i = 1,3 do
On this machine (Windows XP) that write returns true - a silent error!
Must be Windows weirdness, because this script does behave as you
expect on Linux.