Dan Jacobson <[EMAIL PROTECTED]> wrote:
> # ls -l ksyms.8.gz
> lrwxrwxrwx  1 root root 19 2005-08-14 02:36 ksyms.8.gz -> ksyms.modutils.8.gz
> # ls -L ksyms.8.gz
> ls: ksyms.8.gz: No such file or directory
>
> Shouldn't that message be more like the following's?:
>
> # ls ksyms.modutils.8.gz
> ls: ksyms.modutils.8.gz: No such file or directory

That would be an improvement.

When you use ls's -L option, that makes it use stat(2) rather
than lstat(2).  To give the better diagnostic, ls would have
to treat ENOENT specially when invoked with -L: it would perform
an additional lstat on the offending file, and if that succeeds,
it'd read the symlink, lstat the referent, and if it too is a symlink,
lstat its referent, etc., until something (lstat or readlink) fails,
or lstat finds a non-symlink.  Watch out for cycles!

That sounds like a significant chunk of new code, just for an
improved diagnostic, but I think it'd be worthwhile.
Anyone interested in the coding exercise?


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to