Annotation of 43BSD/contrib/cpm/src/delete.c, revision 1.1.1.1

1.1       root        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: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.