Mercurial > hg > CbC > CbC_xv6
annotate src/usr/rm.c @ 48:58ec26c64601
fix_makefile.inc use *.cbc files
author | anatofuz |
---|---|
date | Wed, 13 Mar 2019 11:29:46 +0900 |
parents | 83c23a36980d |
children |
rev | line source |
---|---|
0 | 1 #include "types.h" |
2 #include "stat.h" | |
3 #include "user.h" | |
4 | |
5 int | |
6 main(int argc, char *argv[]) | |
7 { | |
8 int i; | |
9 | |
10 if(argc < 2){ | |
11 printf(2, "Usage: rm files...\n"); | |
12 exit(); | |
13 } | |
14 | |
15 for(i = 1; i < argc; i++){ | |
16 if(unlink(argv[i]) < 0){ | |
17 printf(2, "rm: %s failed to delete\n", argv[i]); | |
18 break; | |
19 } | |
20 } | |
21 | |
22 exit(); | |
23 } |