+command_ret_t do_rm(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc, char * const argv[])
+{
+ DIR Dir; /* Directory object */
+ FILINFO Finfo;
+ FRESULT res;
+
+ if (argc < 2)
+ err("missing operand");
+
+ for (int i = 1; i < argc; i++) {
+ if (!path_set(&from, argv[1])) {
+ /* TODO: error out*/
+ }
+ char *pattern = path_basename_pattern(&from);
+
+ //debug_rm("==== path: '%s', pattern: '%s'\n", from.p_path ? from.p_path : "<NULL>", pattern ? pattern : "<NULL>");
+
+ res = f_findfirst(&Dir, &Finfo, from.p_path, pattern);
+ while (res == FR_OK && Finfo.fname[0]) {
+ if (!(Finfo.fattrib & AM_DIR)) {
+ if ((res = f_unlink(Finfo.fname)) != FR_OK) {
+ put_rc(res);
+ break;
+ }
+ }
+ res = f_findnext(&Dir, &Finfo);
+ }
+ f_closedir(&Dir);
+ }
+
+ if (res) {
+ put_rc(res);
+ return CMD_RET_FAILURE;
+ }
+
+ return CMD_RET_SUCCESS;
+}
+
+command_ret_t do_rmdir(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc, char * const argv[])
+{
+}
+
+command_ret_t do_mkdir(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc, char * const argv[])
+{
+}
+
+