[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: file:write error handling behavior
- From: David Manura <dm.lua@...>
- Date: Tue, 20 Jan 2009 00:00:50 -0500
The Lua reference manual doesn't describe the error handling behavior
of file:write and some related functions. In practice, file:write
returns a true on success and (nil, errorstring, errornumber) on error
given the return status of the underlying fwrite[1]. file:read
behaves similarly. The iterator function returned by file:lines()
raises on error. The reference manual does, however, say that
file:seek returns nil plus a string on error.
[1] http://www.opengroup.org/onlinepubs/007908775/xsh/fwrite.html