fs Implement del command
This commit is contained in:
17
user/fs/del.c
Normal file
17
user/fs/del.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
|
||||
void fs_del(void) {
|
||||
if (argslen() < 2) {
|
||||
uprintf("fs: Not enough arguments\n");
|
||||
return;
|
||||
}
|
||||
|
||||
char *path = *(args()+1);
|
||||
|
||||
int32_t r = fs_delete(path);
|
||||
if (r != E_OK) {
|
||||
uprintf("fs: could not delete %s\n", path);
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
#define CMDS(X) \
|
||||
X(fetch) X(mkf) X(mkd) \
|
||||
X(tree) X(mount)
|
||||
X(tree) X(mount) X(del)
|
||||
|
||||
void main(void) {
|
||||
if (argslen() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user