diff mbox series

[v3,19/26] cmd: fat: add fatrm command

Message ID 20180911065922.19141-20-takahiro.akashi@linaro.org
State Accepted
Commit d4b751e9f3efc5f230c0596c082ba13ca89618e1
Headers show
Series subject: fs: fat: extend FAT write operations | expand

Commit Message

AKASHI Takahiro Sept. 11, 2018, 6:59 a.m. UTC
From: AKASHI Takahiro <takahiro.akashi@linaro.org>

In this patch, a new command, fatrm, is added so as to delete a file
or directory.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 cmd/fat.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/cmd/fat.c b/cmd/fat.c
index b685bf70a2b3..4b9a7eaab054 100644
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -152,6 +152,18 @@  U_BOOT_CMD(
 	"      to 'dev' on 'interface'"
 );
 
+static int do_fat_rm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	return do_rm(cmdtp, flag, argc, argv, FS_TYPE_FAT);
+}
+
+U_BOOT_CMD(
+	fatrm,	4,	1,	do_fat_rm,
+	"delete a file",
+	"<interface> [<dev[:part]>] <filename>\n"
+	"    - delete a file from 'dev' on 'interface'"
+);
+
 static int do_fat_mkdir(cmd_tbl_t *cmdtp, int flag, int argc,
 			char * const argv[])
 {