2012-01-30 17:41:33 -05:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
2013-03-05 15:46:48 -05:00
|
|
|
|
2012-01-30 17:41:33 -05:00
|
|
|
#include "../fs.h"
|
|
|
|
#include "../util.h"
|
|
|
|
|
2013-03-05 15:46:48 -05:00
|
|
|
bool rm_fflag = false, rm_rflag = false;
|
2012-01-30 17:41:33 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
rm(const char *path)
|
|
|
|
{
|
2014-11-13 13:54:28 -05:00
|
|
|
if (rm_rflag)
|
2012-01-30 17:41:33 -05:00
|
|
|
recurse(path, rm);
|
2014-11-13 13:54:28 -05:00
|
|
|
if (remove(path) == -1 && !rm_fflag)
|
2012-01-30 17:41:33 -05:00
|
|
|
eprintf("remove %s:", path);
|
|
|
|
}
|