/*    DeleteLink  (or NewDeleteLink ;-)  
 *        by
 *    Phil Dietz -- NCEMRSoft 1991
 *
 *    USAGE:    DeleteLink <file>
 *
 *    SUMMARY:  Deletes a soft link pointing to an unmounted file
 *              which Commodore's 'delete' SHOULD do, but doesn't.
 *              Note:  DeleteLink will delete ANY file so use with
 *                     extreme caution!
 *
 *    TIPS:     You know you have a bad soft link when:
 *              NewList6 shows 'link -> :UNKNOWN FILE:
 *          or     "       "   'link -> !some_file
 *
 *              The link is not bad, it's just that you can't delete
 *              the link whenver you want.  That's why deletelink is here.
 *
 *    REQUIREMENTS:  WB2.0 version 37
 *
 *    CAUTION:  DeleteLink will delete ANY file.  Watch what
 *              you are doing!
 *                
 *    COMPILE:  lc -Lt -ccurfist -rr -ms -O -v -b1 DeleteLink.c
 */

#include <stdio.h>
#include <stdlib.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <clib/dos_protos.h>
#include <pragmas/dos_pragmas.h>

extern struct DOSBase *DOSBase;

int main(int argc, char **argv)
   {
   if (!(struct DosLibrary *)OpenLibrary("dos.library", 37)) exit(1);
   if (argc<2) 
      {
      PutStr("Usage: DeleteLink <filename>\n");
      exit(1);
      }
   if (!(DeleteFile(argv[1]))) PutStr("Failed.\n");
   }
