shell: mufs: add rmdir command

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 639388588b
commit 4e02f0417b
  1. 10
      source/shell/mufs.c

@ -17,12 +17,14 @@
static void do_mufs_mount(const char *s);
static void do_mufs_format(const char *s);
static void do_mufs_mkdir(const char *s);
static void do_mufs_rmdir(const char *s);
static void do_mufs_ls(const char *s);
static struct cmd mufs_cmds[] = {
{ "mount", do_mufs_mount },
{ "format", do_mufs_format },
{ "mkdir", do_mufs_mkdir },
{ "rmdir", do_mufs_rmdir },
{ "ls", do_mufs_ls },
{ NULL, NULL },
};
@ -71,6 +73,14 @@ static void do_mufs_mkdir(const char *s)
}
}
static void do_mufs_rmdir(const char *s)
{
if (mufs_rmdir(&mufs, s) < 0) {
fprintf(stderr, "error: unable to remove the directory\n");
return;
}
}
static void do_mufs_ls(const char *s)
{
struct mufs_dirent ent;

Loading…
Cancel
Save