forget difference between big and small commands - obsolete with vm.
[minix.git] / commands / simple / rmdir.c
blob6d4ba833d3f30d12d8fbd0180fef2eb810591beb
1 /* rmdir - remove directory. Author: Kees J. Bot
2 */
3 #define nil 0
4 #include <sys/types.h>
5 #include <stddef.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <unistd.h>
9 #include <errno.h>
11 void tell(char *what)
13 write(2, what, strlen(what));
16 void report(char *label)
18 char *err= strerror(errno);
20 tell("rmdir: ");
21 tell(label);
22 tell(": ");
23 tell(err);
24 tell("\n");
27 int main(int argc, char **argv)
29 int i, ex= 0;
31 if (argc < 2) {
32 tell("Usage: rmdir directory ...\n");
33 exit(1);
36 i=1;
37 do {
38 if (rmdir(argv[i]) < 0) {
39 report(argv[i]);
40 ex= 1;
42 } while (++i < argc);
44 exit(ex);
46 /* Kees J. Bot 27-12-90. */