Ian Jackson <[EMAIL PROTECTED]> wrote: > Ian Jackson writes ("Re: Bug#369822: ls -i stats unnecessarily"): >> There are I think two approaches to this problem: >> * find a list of mountpoints in some system-specific way >> for each one stat mountpoint/.. >> compare device and inode with those of the directory we're readdir'ing >> * provide an option to allow the user to specify that they don't >> mind the inode numbers of mountpoints being wrong > > Someone has just pointed out to me that no matter what you do, you > don't get the dev for the covering filesystem. So returning the inum > of the root of the covering fs is definitely wrong and should never be > done. > > Think about it: if you ls -i anywhere near a mount point you're > _inevitably_ going to get useless data because the output doesn't > contain devs. So anyone who does ls -i usefully must know that there > are no mountpoints and this whole issue can be ignored.
I still think we'll need an option. Otherwise (with the current/trunk optimization), for each of these special directories, ls -i reports different inode numbers depending on whether it appears as a command line argument (in which case, ls must lstat (or stat) it) or it is encountered as an entry in some other directory. Besides, from a portability standpoint, GNU ls -i should continue to work the same way it always has, wrt mount points: print what is usually a `2' for each of them. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils