RTEMS Logo

RTEMS 4.9.4 On-Line Library


File and Directory Commands rm - remove files

PREV UP NEXT Bookshelf RTEMS Shell User's Guide

3.2.11: rm - remove files

SYNOPSYS:

rm file1 [file2 ... fileN]

DESCRIPTION:

This command deletes a name from the filesystem. If the specified file name was the last link to a file and there are no open file descriptor references to that file, then it is deleted and the associated space in the file system is made available for subsequent use.

If the filename specified was the last link to a file but there are open file descriptor references to it, then the file will remain in existence until the last file descriptor referencing it is closed.

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 rm:

SHLL [/] # cp /etc/passwd tmpfile
SHLL [/] # cat tmpfile
root:*:0:0:root::/:/bin/sh
rtems:*:1:1:RTEMS Application::/:/bin/sh
tty:!:2:2:tty owner::/:/bin/false
SHLL [/] # rm tmpfile
SHLL [/] # cat tmpfile
cat: tmpfile: No such file or directory

CONFIGURATION:

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

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

PROGRAMMING INFORMATION:

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

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

The configuration structure for the rm has the following prototype:

extern rtems_shell_cmd_t rtems_shell_RM_Command;


PREV UP NEXT Bookshelf RTEMS Shell User's Guide

Copyright © 1988-2008 OAR Corporation