home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 10
/
Fresh_Fish_10_2352.bin
/
useful
/
util
/
edit
/
mg
/
src.lzh
/
tools
/
rm.c
< prev
Wrap
C/C++ Source or Header
|
1990-05-23
|
555b
|
25 lines
/* A qad replacement for delete that doesn't blow it's stack on errors */
#include <stdio.h>
#include <stdlib.h>
void
main(argc, argv) /* delete: delete files */
int argc;
char *argv[];
{
register char *my_name = argv[0] ;
register int errors = 0;
if (argc < 2) /* no args; copy standard input */
fprintf(stderr, "Usage: %s file [file ...]\n", my_name);
else
while (--argc > 0) {
argv += 1 ;
if (unlink(*argv) != 0) {
fprintf(stderr, "%s: Can't remove %s\n", my_name, *argv) ;
errors = 5 ;
}
}
exit(errors);
}