RTEMS Logo

RTEMS 4.9.0 On-Line Library


File and Directory Commands chdir - change the current directory

PREV UP NEXT Bookshelf RTEMS Shell User's Guide

3.2.5: chdir - change the current directory

SYNOPSYS:

chdir [dir]

DESCRIPTION:

This command is used to change the current working directory to the specified directory. If no arguments are given, the current working directory will be changed to /.

EXIT STATUS:

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

NOTES:

NONE

EXAMPLES:

The following is an example of how to use chdir:

SHLL [/] $ pwd
/
SHLL [/] $ chdir etc
SHLL [/etc] $ pwd
/etc

CONFIGURATION:

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

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

PROGRAMMING INFORMATION:

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

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

The configuration structure for the chdir has the following prototype:

extern rtems_shell_cmd_t rtems_shell_CHDIR_Command;


PREV UP NEXT Bookshelf RTEMS Shell User's Guide

Copyright © 1988-2008 OAR Corporation