implement cp and mv and improve rm
This commit is contained in:
17
util/rm.c
Normal file
17
util/rm.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include "../fs.h"
|
||||
#include "../util.h"
|
||||
|
||||
bool rm_fflag = false;
|
||||
bool rm_rflag = false;
|
||||
|
||||
void
|
||||
rm(const char *path)
|
||||
{
|
||||
if(rm_rflag)
|
||||
recurse(path, rm);
|
||||
if(remove(path) == -1 && !rm_fflag)
|
||||
eprintf("remove %s:", path);
|
||||
}
|
Reference in New Issue
Block a user