home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
500-599
/
ff597.lzh
/
NewList
/
LinkStuff
/
DeleteLink.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-01
|
1KB
|
46 lines
/* 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");
}