1: /*	delete.c	1.7	85/03/24	*/
   2: 
   3: #include <stdio.h>
   4: #include "cpmio.h"
   5: #include "cpmfio.h"
   6: 
   7: /*
   8:  * Delete cp/m file
   9:  */
  10: 
  11: delete(cmdline)
  12:     char *cmdline;
  13: {
  14: 
  15:     char name[9], ext[4], *fixname();
  16:     register C_FILE *cio;
  17: 
  18:     if (!(namesep(cmdline, name, ext)))
  19:         return;
  20:     if (searchdir(name, ext) == -1) {
  21:         fprintf(stderr, "File not found: %s\n", fixname(name, ext));
  22:         return;
  23:     }
  24:     cio = c_open(name, ext, READ);
  25:     cio->c_dirp->status = (char) 0xe5;
  26:     while(cio->c_dirp->blkcnt == (char) 0x80 && getnext(cio) != 0)
  27:         cio->c_dirp->status = (char) 0xe5;
  28:     savedir();
  29:     c_close(cio);
  30:     /*
  31: 	 * rebuild the bitmap completely instead of recovering
  32:          * each block as they are deleted
  33: 	 */
  34:     build_bmap();
  35:     fprintf(stderr, "%s deleted\n", fixname(name, ext));
  36: }

Defined functions

delete defined in line 11; used 1 times
Last modified: 1985-03-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 817
Valid CSS Valid XHTML 1.0 Strict