lua-users home
lua-l archive

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


> 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.

It cannot :(  The error codes from 'rename' are the same; for instance:

   EACCES Write  permission is denied for the directory containing oldpath
          or newpath, or, search permission  is  denied  for  one  of  the
          directories in the path prefix of oldpath or newpath, or oldpath
          is a directory and does not allow write  permission  (needed  to
          update the ..  entry).  (See also path_resolution(7).)

   ENOENT The link named by oldpath does not exist; or, a directory compo‐
          nent  in  newpath  does  not exist; or, oldpath or newpath is an
          empty string.

Probably not to show any file name is the best approach.

-- Roberto