/* * Sample program for mkdir system call - No.39 * * mkdir - create a directory * * Synopsis * #include * #include * * int mkdir(const char *pathname, mode_t mode); * * Description * mkdir attempts to create a directory named pathname. * * mode specifies the permissions to use. It is modified by * the process's umask in the usual way: the permissions of * the created file are (mode & umask). */ #include main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "argument mismatch\n"); exit(1); } if (mkdir(argv[1], 777) == -1) { perror("mkdir"); exit(1); } exit(0); }