/* * Sample program for rmdir system call - No.40 * * rmdir - delete a directory * * Synopsis * #include * * int rmdir(const char *pathname); * * Description * rmdir deletes a directory, which must be empty. */ #include main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "argument mismatch\n"); exit(1); } if (rmdir(argv[1]) == -1) { perror("rmdir"); exit(1); } exit(0); }