2012-01-30 22:41:33 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <stdio.h>
|
2013-03-05 20:46:48 +00:00
|
|
|
|
2012-01-30 22:41:33 +00:00
|
|
|
#include "../fs.h"
|
|
|
|
#include "../util.h"
|
|
|
|
|
2014-11-13 20:24:47 +00:00
|
|
|
int rm_fflag = 0;
|
|
|
|
int rm_rflag = 0;
|
2015-01-30 11:45:54 +00:00
|
|
|
int rm_status = 0;
|
2012-01-30 22:41:33 +00:00
|
|
|
|
|
|
|
void
|
2015-02-16 16:23:12 +00:00
|
|
|
rm(const char *path, int unused)
|
2012-01-30 22:41:33 +00:00
|
|
|
{
|
2014-11-13 18:54:28 +00:00
|
|
|
if (rm_rflag)
|
2015-02-09 19:53:24 +00:00
|
|
|
recurse(path, rm, 'P');
|
2015-01-30 11:45:54 +00:00
|
|
|
if (remove(path) < 0) {
|
|
|
|
if (!rm_fflag)
|
|
|
|
weprintf("remove %s:", path);
|
|
|
|
rm_status = 1;
|
|
|
|
}
|
2012-01-30 22:41:33 +00:00
|
|
|
}
|