Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!ccfiris.aedc!c60244 From: c60244@ccfiris.aedc (Kenny McDonald) Newsgroups: comp.sys.sgi Subject: ERASE UTILITY Message-ID: <9103222108.AA01096@ccfiris.aedc> Date: 22 Mar 91 21:08:56 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 111 The following is a copy of the utility I wrote: ______________________________________________________________________________ #include #include #include #include main(argc,argv) int argc; char *argv[]; { int i,fd,j,size, confirm=0, ch; char word1=0, word2=0xff, word3=0x44, ans[4]; struct stat buf; extern int optind; /* parse the command line for the argument -i to interactively ask the */ /* user if he wants to remove the file after being overwritten. */ while ((ch = getopt (argc,argv,"i")) != EOF) { switch (ch) { case 'i': confirm++; break; case '?': printf ("usage: %s [-i] file [file ...]\n",argv[0]); exit(1); break; } } /* check to make sure the user entered a file name */ if ((argc-optind)<1) { printf ("usage: %s [-i] file [file ...]\n",argv[0]); exit(1); } /* for each file on the command line do the overwrite */ j=optind; while (j