Re: confusing error message in os.rename (bug?)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: confusing error message in os.rename (bug?)
- From: Wolfram Ladurner <wl@...>
- Date: 2012年10月18日 16:00:14 +0200
Am 18.10.2012 15:05, schrieb Luiz Henrique de Figueiredo:
$ lua -e 'assert( os.rename( "testfile", "/does/not/exist" ) )'
lua: <command line>:1: testfile: No such file or directory
The message comes from the OS. There is nothing we can do about it.
Try it on the command line:
mv testfile /does/not/exist
You'll get
mv: rename testfile to /does/not/exist: No such file or directory
You are right, "No such file or directory" comes from the OS, but the
"testfile: " comes from Lua. I can live with that, but I still think
it's misleading.
(mv also shows different messages, depending on whether the old or the
new name is incorrect:)
$ mv testfile /does/not/exists
mv: cannot move `testfile' to `/does/not/exists': No such file or directory
$ mv /does/not/exist testfile
mv: cannot stat `/does/not/exist': No such file or directory
--
Wolfram Ladurner