Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!ames!ucbcad!ucbvax!decvax!dartvax!vizard From: vizard@dartvax.UUCP (Todd Krein) Newsgroups: comp.os.minix Subject: Diffs for df.c Message-ID: <6136@dartvax.UUCP> Date: Mon, 4-May-87 16:20:24 EDT Article-I.D.: dartvax.6136 Posted: Mon May 4 16:20:24 1987 Date-Received: Sat, 9-May-87 02:13:14 EDT Organization: Dartmouth College, Hanover, NH Lines: 73 Keywords: Pretty output [munch] Here's a diff listing of changes I've made to 'df.c'. The changes give an output more like that from BSD. The old format is still available by using the '-i' flag. diff df.c df.new 1a2 > /* modified 5/1/87 to give nice output Todd Krein */ 9a11 > int nice; /* want a nice listing? */ 17a20,21 > nice = 1; /* assume yes */ > 38a43,56 > if (name[0] == '-') { /* an option, huh? */ > switch(name[1]) { > case 'n': > nice = 1; /* make it nice */ > return; > case 'i': /* inode stuff */ > nice = 0; > return; > default: > prints("Bad option '%c' : df\n",name[1]); > return; > } > } > 87c105 < prints("%s ",name); --- > prints("%s ",name); /* print name in field */ 92,100c110,132 < prints("i-nodes: "); < num3(i_count - 1); < prints(" used "); < num3(sp->s_ninodes + 1 - i_count); < prints(" free blocks: "); < num3(busyblocks); < prints(" used "); < num3(totblocks - busyblocks); < prints(" free\n"); --- > > if (nice == 0) { /* wants inode info */ > prints("i-nodes: "); > num3(i_count - 1); > prints(" used "); > num3(sp->s_ninodes + 1 - i_count); > prints(" free blocks: "); > num3(busyblocks); > prints(" used "); > num3(totblocks - busyblocks); > prints(" free\n"); > } > else { > prints("Kbytes: "); > num3((int)(((long)totblocks * (long)BLOCK_SIZE)/(long)1000)); > prints(" used "); > num3((int)(((long)busyblocks * (long)BLOCK_SIZE)/(long)1000)); > prints(" avail "); > num3((int)(((long)(totblocks - busyblocks) * (long)BLOCK_SIZE)/(long)1000)); > prints(" capacity "); > num3((int)(((long)busyblocks*(long)100)/(long)totblocks)); > prints("%\n"); > } Todd Krein vizard@dartvax