18 lines
319 B
C
18 lines
319 B
C
#include <stdio.h>
|
|
#include <sys/stat.h>
|
|
#include <errno.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
if (argc != 2) {
|
|
printf("Usage: mkdir <dirname>\n");
|
|
return 1;
|
|
}
|
|
|
|
// 0755: 권한 (rwxr-xr-x)
|
|
if (mkdir(argv[1], 0755) < 0) {
|
|
perror("mkdir");
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
} |