RTEMS Logo

RTEMS 4.10.2 On-Line Library


File and Directory Commands mkdir - create a directory

PREV UP NEXT Bookshelf RTEMS Shell User's Guide

3.2.7: mkdir - create a directory

SYNOPSYS:

mkdir  dir [dir1 .. dirN]

DESCRIPTION:

This command creates the set of directories in the order they are specified on the command line. If an error is encountered making one of the directories, the command will continue to attempt to create the remaining directories on the command line.

EXIT STATUS:

This command returns 0 on success and non-zero if an error is encountered.

NOTES:

If this command is invoked with no arguments, nothing occurs.

The user must have sufficient permissions to create the directory. For the fileio test provided with RTEMS, this means the user must login as root not rtems.

EXAMPLES:

The following is an example of how to use mkdir:

SHLL [/] # ls
drwxr-xr-x   1   root   root         536 Jan 01 00:00 dev/
drwxr-xr-x   1   root   root        1072 Jan 01 00:00 etc/
2 files 1608 bytes occupied
SHLL [/] # mkdir joel
SHLL [/] # ls joel
0 files 0 bytes occupied
SHLL [/] # cp etc/passwd joel
SHLL [/] # ls joel
-rw-r--r--   1   root   root         102 Jan 01 00:02 passwd
1 files 102 bytes occupied

CONFIGURATION:

This command is included in the default shell command set. When building a custom command set, define CONFIGURE_SHELL_COMMAND_MKDIR to have this command included.

This command can be excluded from the shell command set by defining CONFIGURE_SHELL_NO_COMMAND_MKDIR when all shell commands have been configured.

PROGRAMMING INFORMATION:

The mkdir is implemented by a C language function which has the following prototype:

int rtems_shell_rtems_main_mkdir(
  int    argc,
  char **argv
);

The configuration structure for the mkdir has the following prototype:

extern rtems_shell_cmd_t rtems_shell_MKDIR_Command;


PREV UP NEXT Bookshelf RTEMS Shell User's Guide

Copyright © 1988-2008 OAR Corporation