source: rtems/cpukit/libmisc/shell/main_rmdir.c @ 7eada71

4.115
Last change on this file since 7eada71 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  RMDIR Shell Command Implmentation
3 *
4 *  Author: Fernando RUIZ CASAS
5 *  Work: fernando.ruiz@ctv.es
6 *  Home: correo@fernando-ruiz.com
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <stdio.h>
18#include <string.h>
19#include <errno.h>
20#include <unistd.h>
21
22#include <rtems.h>
23#include <rtems/shell.h>
24#include "internal.h"
25
26static int rtems_shell_main_rmdir (int argc, char *argv[])
27{
28  char *dir;
29  int n;
30
31  n = 1;
32  while (n < argc) {
33    dir = argv[n++];
34    if (rmdir(dir)) {
35      fprintf(stderr,"%s: %s: %s\n", argv[0], dir, strerror(errno));
36      return -1;
37    }
38  }
39  return 0;
40}
41
42rtems_shell_cmd_t rtems_shell_RMDIR_Command = {
43  "rmdir",                                      /* name */
44  "rmdir  dir   # remove directory",            /* usage */
45  "files",                                      /* topic */
46  rtems_shell_main_rmdir,                       /* command */
47  NULL,                                         /* alias */
48  NULL                                          /* next */
49};
Note: See TracBrowser for help on using the repository browser.