[Toybox] default ls behavior on a broken symlink

Ryan Prichard rprichard at google.com
Mon Nov 13 14:14:04 PST 2017


I noticed that Toybox's ls prints a "No such file or directory" error for a
broken symlink, whereas GNU coreutils and FreeBSD's ls instead print the
name of the symlink successfully. Is this considered a bug in Toybox?

e.g.

$ ln -s A B

$ /bin/ls -ld A
/bin/ls: cannot access A: No such file or directory

$ ~/toybox/toybox ls B ; echo $?
ls: B: No such file or directory
1

$ ~/toybox/toybox ls -l B ; echo $?
lrwxrwxrwx 1 rprichard 5000 1 2017-11-13 14:06 B -> A
0

$ /bin/ls B ; echo $?
B
0

$ /bin/ls -l B ; echo $?
lrwxrwxrwx 1 rprichard eng 1 Nov 13 14:06 B -> A
0

-Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20171113/834a7692/attachment.htm>


More information about the Toybox mailing list