On Friday 06 June 2008 22:13, Ralf Friedl wrote:
> Denys Vlasenko wrote:
> > Well, I don't understand what the original post implies. What ls
> > should do instead? It has to obtain filename list SOMEHOW, no?
> > It can be done only by asking the kernel to do readdir, [l]stat,
> > etc.
> In case of "ls" without options, readdir() without lstat would be 
> enough, if busybox would not do colored output by default.

Well, this is true only if you want a bare list of files.
No coloring, no file type suffixes ("dir/"), no recursion (-R),
no file info (-l).

In other words, this is an optimization which is "nice to have"
but in real world usage it won't happen to be used as often
as one might want.

Back to "NFS stall" question: readdir will stall as readily as lstat
if the NFS server is down.

> Coreutils "ls" does not lstat when it doesn't create colored output 
> (which is default if stdout is not a tty), because the stat information 
> is not used in that case..

Yes.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to