File indexing completed on 2025-05-11 08:24:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifdef HAVE_CONFIG_H
0016 #include "config.h"
0017 #endif
0018
0019 #include <stdio.h>
0020 #include <string.h>
0021 #include <stdlib.h>
0022 #include <errno.h>
0023 #include <sys/stat.h>
0024 #include <sys/types.h>
0025
0026 #include <rtems.h>
0027 #include <rtems/shell.h>
0028 #include "internal.h"
0029
0030 static int rtems_shell_main_mkdir(
0031 int argc,
0032 char *argv[]
0033 )
0034 {
0035 char *dir;
0036 int n;
0037
0038 n = 1;
0039 while (n<argc) {
0040 dir = argv[n++];
0041 if (mkdir(dir,S_IRWXU|S_IRWXG|S_IRWXO)) {
0042 fprintf(stderr, "mkdir '%s' failed:%s\n", dir, strerror(errno));
0043 }
0044 }
0045 return errno;
0046 }
0047
0048 rtems_shell_cmd_t rtems_shell_MKDIR_Command = {
0049 "mkdir",
0050 "mkdir dir # make a directory",
0051 "files",
0052 rtems_shell_main_mkdir,
0053 NULL,
0054 NULL
0055 };