Subject: Re: bin/560: ls -i returns incorrect inodes on symlinks and root dirs
To: None <greywolf@autodesk.com, jtk@kolvir.blrc.ma.us>
From: Christopher Hooper <cdh@mtu.edu>
List: netbsd-bugs
Date: 11/08/1994 01:29:02
John Kohl wrote:
> I am surprised to hear that ls(1) on older BSD systems give you the
> inumber of the mounted-over directory!
Well, considering the semantics of access to the (pre 4.4)
directory structure, I would say it would be wrong to do it
any other way than give you the inode number of the underlying
directory. Should ls have had to stat the inode for _every_
file it encountered in the directory? I would hope not. The
stat would have been required, however, if you expected to
know the type of file (symbolic link or root of another
filesystem for instance) being examined.
The problem now is that ls now DOES a stat (lstat) for every
file in a directory. This may not be terribly noticeable
on a local filesystem with a hundred or so files, but it is
VERY noticeable on an NFS mounted mail spool with about
7,842 files. I guess with the zeal to do ls "properly,"
performance becomes impertinent.
- Chris Hooper Michigan Technological University Office: 208A Benedict
cdh@mtu.edu Metallurgy / Mining System Administrator Phone: (906)487-3201