[net.unix-wizards] USG 5.0 "find" and "ls" blocksize questions

derek@sask.UUCP (Derek Andrew) (10/09/83)

While some systems use 512 byte blocks and others use 1024 byte blocks, it
would indeed be handy if the output of ls and df reported the same numbers
so one could compare different systems.  I think that these programs should
not report blocks, but rather Kilobytes used.  This removes the hardware
dependencies.  This brings up the question:

	If a file is less than 512 bytes and the system uses 512 byte
	blocks, is it alright for du to say the file consumes 1K?

This message is posted in response to the ongoing discussion of the
differences between what the different programs (ls, du, df, find) 
consider the file size to be.

Derek Andrew; U of Saskatchewan; utah-cs!sask!derek

henry@utzoo.UUCP (Henry Spencer) (10/13/83)

The folks from Interactive Systems addressed this issue a little
while ago in a talk about how they handled portability issues among
the different Unixes.  (Yes, I am aware that Interactive doesn't
always practice what it preaches...)  They took the view that all
software which reports numbers of blocks reports numbers of 512-byte
blocks, regardless of the prejudices of the particular filesystem it
happens to be using.  Consider System V with both 512-byte and 1024-
byte filesystems on the same machine.  Or, worse, 4.2BSD.  If the
notion of "block" is to be visible to the user at all, it has to be
something reasonably implementation-independent.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry