2011-11-21 12:49:55 -05:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
2011-11-22 11:26:47 -05:00
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
2011-11-26 05:00:45 -05:00
|
|
|
#include <error.h>
|
2011-11-21 12:49:55 -05:00
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2011-11-23 11:05:09 -05:00
|
|
|
if ( argc < 2 ) { printf("usage: %s <file> ...\n", argv[0]); return 0; }
|
2011-11-21 12:49:55 -05:00
|
|
|
|
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
for ( int i = 1; i < argc; i++ )
|
|
|
|
{
|
|
|
|
if ( unlink(argv[i]) )
|
|
|
|
{
|
2011-11-26 05:00:45 -05:00
|
|
|
error(0, errno, "cannot remove %s", argv[i]);
|
2011-11-21 12:49:55 -05:00
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|