/* * This is supposed to emulate the behavior of the ORCA/Shell script * 'removerez'. * * Devin Reade, February 1998 * * $Id: removerez.c,v 1.2 1998/04/10 20:19:24 gdr-ftp Exp $ */ #define __USE_DYNAMIC_GSSTRING__ #include #include #include #include #include #include #include #include #include int main (int argc, char **argv) { static FileInfoRecGS finfo; int i, quiet, usage, verbose; char *filename, *tempfile, *dname; GSStringPtr filenameGS, tempfileGS; unsigned short copyflags; __REPORT_STACK(); /* initialization */ quiet = usage = verbose = 0; copyflags = LC_COPY_DATA | LC_COPY_KEEPBUF | LC_COPY_BACKUP; while ((i = getopt(argc, argv, "qv")) != EOF) { switch(i) { case 'v': quiet = 0; verbose = 1; break; case 'q': quiet = 1; verbose = 0; break; default: usage = 1; } } if (usage || (argc-optind)<1) { errx(EXIT_FAILURE, "usage: %s file [...]\n", argv[0]); } for (i=optind; i