Why do you want a 512 byte block file system anyway?

Heiko Blume src at scuzzy.in-berlin.de
Fri Nov 30 03:38:08 AEST 1990


tneff at bfmny0.BFM.COM (Tom Neff) writes:

>I hesitate to suggest someone else write a program I don't have the time
>to write myself, but perhaps that awk script could be posted in some
>form?  It would be Real Nice if people could run something that told
>them, numerically, what they currently stood to gain and/or lose by
>installing a given file tree onto filesystems of various blocksizes.

i rather hesitate to post something as simple as this little c program,
but what the heck...


main() {
	int x,w,n,s512,s1,s2,s3,s4,i;
	x=w=n=s512=s1=s2=s3=i=0;

	for(;;) {
		if((scanf("%d",&i))==-1) break;;
		x++;
		if(i % 1024 <= 512) w++;
		else n++;
		if(i <= 512) s512++;
		else if(i <= 1024) s1++;
		else if(i <= 1536) s2++;
		else if(i <= 2048) s3++;
		else s4++;
	}

	printf("<= 512: %d\n",s512);
	printf("<= 1024: %d\n",s1); /* but > 512 */
	printf("<= 1536: %d\n",s2); /* but > 1024 */
	printf("<= 2048: %d\n",s3); /* etc */
	printf(">= 2048: %d\n",s4);
	printf("total  : %d\n",x);
	printf("savings on %d files\n",w);
	printf("no savings on %d files\n",n);
}

to use this do a 
find /usr/spool/news -print | xargs ls -l | cut -c32-40 | sort > bla
edit out the blank lines from bla and then do a
<the program above> < bla

that yields the little statistic.

feel free to do whatever you want to with this Great Piece Of Software (tm) :-)
-- 
      Heiko Blume <-+-> src at scuzzy.in-berlin.de <-+-> (+49 30) 691 88 93
                    public source archive [HST V.42bis]:
        scuzzy Any ACU,f 38400 6919520 gin:--gin: nuucp sword: nuucp
                     uucp scuzzy!/src/README /your/home



More information about the Comp.unix.sysv386 mailing list