summaryrefslogtreecommitdiffstats
path: root/commands/mkdir.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:02:14 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:02:14 +0200
commitb2c5310d4da56237571bb8ea8d24b030c941030f (patch)
treec2c39f8c1ebdad8c3e69af86cb3c105434212edd /commands/mkdir.c
parentfda840672d0eb662ddf4c7080532fe2dfeb0b0b1 (diff)
downloadbarebox-b2c5310d4da56237571bb8ea8d24b030c941030f.tar.gz
barebox-b2c5310d4da56237571bb8ea8d24b030c941030f.tar.xz
svn_rev_653
restructure tree, add reginfo command
Diffstat (limited to 'commands/mkdir.c')
-rw-r--r--commands/mkdir.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/commands/mkdir.c b/commands/mkdir.c
new file mode 100644
index 0000000000..3be742a942
--- /dev/null
+++ b/commands/mkdir.c
@@ -0,0 +1,35 @@
+#include <common.h>
+#include <command.h>
+#include <fs.h>
+#include <errno.h>
+
+static int do_mkdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+ int i = 1;
+
+ if (argc < 2) {
+ u_boot_cmd_usage(cmdtp);
+ return 1;
+ }
+
+ while (i < argc) {
+ if (mkdir(argv[i])) {
+ printf("could not create %s: %s\n", argv[i], errno_str());
+ return 1;
+ }
+ i++;
+ }
+
+ return 0;
+}
+
+static __maybe_unused char cmd_mkdir_help[] =
+"Usage: mkdir [directories]\n"
+"Create new directories\n";
+
+U_BOOT_CMD_START(mkdir)
+ .maxargs = CONFIG_MAXARGS,
+ .cmd = do_mkdir,
+ .usage = "make directories",
+ U_BOOT_CMD_HELP(cmd_mkdir_help)
+U_BOOT_CMD_END