Block Size Program

Duston, Hal hdusto01 at sprintspectrum.com
Mon Jul 8 14:04:01 CDT 2002


Jonathan Hutchins [mailto:hutchins at opus1.com] wrote:
> > -----Original Message-----
> > From: Gerald Combs [mailto:gerald at ethereal.com]
> > 
> > Odd.  On my Linux desktop, the man page for 'ls' states that 
> > the '-s' flag shows sizes in blocks.  
> 
> I'm not sure who got the VMS filespec mixed in here, but the 
> various version of Linux I have installed all user 1K blocks.  
> VMS still uses 512 Byte blocks, hence your storage looks twice 
> as big as it really is.

Probably from POSIX.  Quoting from the IEEE standards draft.

"In an early proposal, the units used to specify the number of 
blocks occupied by files in a directory in an ls -l listing was 
implementation-defined. This was because BSD systems have 
historically used 1 024-byte units and System V systems have 
historically used 512-byte units. It was pointed out by BSD 
developers that their system has used 512-byte units in some 
places and 1 024-byte units in other places. (System V has 
consistently used 512.) Therefore, this volume of 
IEEE Std 1003.1-200x usually specifies 512. Future releases of 
BSD are expected to consistently provide 512 bytes as a default 
with a way of specifying 1 024-byte units where appropriate."

"FUTURE DIRECTIONS
The -s uses implementation-defined units and cannot be used 
portably; it may be withdrawn in a future issue."

Also both floppies and hard disks use 512 byte blocks.

Hal




More information about the Kclug mailing list