aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/rm.c
blob: 0db7f7b2aedfa8e98a221d3c685f67ca393a18fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* rm.c

   Removes files specified on command line. */

#include <stdio.h>
#include <syscall.h>

int
main (int argc, char *argv[]) 
{
  bool success = true;
  int i;
  
  for (i = 1; i < argc; i++)
    if (!remove (argv[i])) 
      {
        printf ("%s: remove failed\n", argv[i]);
        success = false; 
      }
  return success ? EXIT_SUCCESS : EXIT_FAILURE;
}