Received: by KSUVM (Mailer R2.07) id 9775; Mon, 08 Oct 90 23:10:34 CDT Date: Tue, 9 Oct 90 00:05:21 EDT Reply-To: Apple II List Sender: Apple II List From: cwilson@nisc.sri.com Subject: strip8.c, unix-type util for striping 8th bit To: "Steven E. Nelson" Due to the fact I haven't gotten around to creating comp.sources.apple2, this appears on comp.binaries.apple2. It's a quick little C hack to strip the 8th bit off a file. Should run on any unix box, compile with 'cc -o strip8 strip8.c' type idea. tested on sun systems.. oh, prints to stdout... ---------->snip<---------------------->snip<---------------------->snip<-------- ---- #include ../* standard io */ main (argc,argv) int argc; char *argv[]; { int.a; char prog[10]; FILE.*fpointer; if (argc>1)..../* check for filename arg */ { strcpy(prog,argv[0]); if (!(fpointer=fopen(argv[1],"r")))./* check for existence */ .{ . perror(prog); . exit(1); .} printf("%s:",argv[1]); } else fpointer=stdin;.../* no filename, use stdin */ do { if((a=fgetc(fpointer))==EOF) break;./* exit if eof */ a &= 0x7f; if (a==13) printf("\n"); else printf("%c",a); } while (!feof(fpointer));.../* do until all done */ printf("\n"); fclose(fpointer); } ---------->snip<---------------------->snip<---------------------->snip<-------- ----