shell: mufs: add rmdir command
This commit is contained in:
parent
639388588b
commit
4e02f0417b
1 changed files with 10 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue