lua-users home
lua-l archive

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


Am 18.10.2012 15:04, schrieb Rob Kendrick:
On Thu, Oct 18, 2012 at 03:00:36PM +0200, Wolfram Ladurner wrote:
$ touch testfile
$ lua -e 'assert( os.rename( "testfile", "/does/not/exist" ) )'
lua: <command line>:1: testfile: No such file or directory
stack traceback:
         [C]: in function `assert'
         <command line>:1: in main chunk
         [C]: ?

The error message looks like the testfile does not exist, while it
is the new name that is causing the error.

Lua has no way of knowing this, it is just reporting the error that the
ANSI C function has signalled.

B.


I know, but Lua always displays the old name at the beginning of the error message, regardless of whether the old or the new name cause the error. IMHO it would be better to show no name at all, unless it can be determined which of them is responsible for the error.

--
Wolfram Ladurner