xref: /original-bsd/bin/mkdir/mkdir.c (revision c374ae69)
1 /*
2  * Copyright (c) 1983 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  */
6 
7 #ifndef lint
8 char copyright[] =
9 "@(#) Copyright (c) 1983 Regents of the University of California.\n\
10  All rights reserved.\n";
11 #endif not lint
12 
13 #ifndef lint
14 static char sccsid[] = "@(#)mkdir.c	5.1 (Berkeley) 04/30/85";
15 #endif not lint
16 
17 /*
18  * make directory
19  */
20 #include <stdio.h>
21 
22 main(argc, argv)
23 	char *argv[];
24 {
25 	int errors = 0;
26 
27 	if (argc < 2) {
28 		fprintf(stderr, "usage: %s directory ...\n", argv[0]);
29 		exit(1);
30 	}
31 	while (--argc)
32 		if (mkdir(*++argv, 0777) < 0) {
33 			fprintf(stderr, "mkdir: ");
34 			perror(*argv);
35 			errors++;
36 		}
37 	exit(errors != 0);
38 }
39