lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


fwrite may not know its operating a read mode file....

在 2011-9-6 下午2:39,"HyperHacker" <hyperhacker@gmail.com>写道:
> 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.
>
> --
> Sent from my toaster.
>