[TUHS] (no subject)

Dennis Ritchie dmr at plan9.bell-labs.com
Fri May 23 14:10:30 AEST 2003


 > The V7 ls(1) man page says that the -s option, which prints total
 >blocks, includes any indirect blocks.

 >However, the V7 struct stat didn't have the st_blocks member in the
 > struct stat, and the code in ls.c uses

 > 	long
 >	nblock(size)
 >	long size;
 >	{
 >		return((size+511)>>9);
 >	}

 >So, is this just a case of the man page being mistaken?

Yes, it looks like a manual bug. Retrieving
the true number of indirect blocks isn't possible
from the 7th edition stat.  I'm not sure when (or by
whom) the st_blocks member was added.

 > While I'm at it, the V7 ls -a option only adds . and .. to the
 > list; apparently all other dot files were printed by default.
 > When did ls change such that -a applied to all dot files?

UCB or USL did this (I'm sure which first).
Both tended to use more . files.

	Dennis



More information about the TUHS mailing list