On Thu, 17 Nov 2005, Jim Meyering wrote:
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?
What about using realpath() ? According to the realpath(3) manpage it
exists on BSD, Linux, and Solaris and gives out an absolute dereferenced
path. This could cut down significantly the necessary code.
Regards,
Theodoros Kalamatianos
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils