sbase/libutil/rm.c

18 lines
289 B
C
Raw Normal View History

2012-01-30 22:41:33 +00:00
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
2012-01-30 22:41:33 +00:00
#include "../fs.h"
#include "../util.h"
int rm_fflag = 0;
int rm_rflag = 0;
2012-01-30 22:41:33 +00:00
void
rm(const char *path)
{
if (rm_rflag)
2012-01-30 22:41:33 +00:00
recurse(path, rm);
2014-11-19 19:59:37 +00:00
if (remove(path) < 0 && !rm_fflag)
2012-01-30 22:41:33 +00:00
eprintf("remove %s:", path);
}