?? mkdir.c
字號:
#include<stdio.h>#include<sys/types.h>#include<unistd.h>#include<string.h>#include<sys/stat.h>#include<stdlib.h>#if defined (BSD) && !_POSIX_SOURCE #include<sys/dir.h> typedef struct direct Dirent;#else #include<dirent.h> typedef struct dirent Dirent;#endifmain(int argc ,char *argv[]) { Dirent *dp; DIR *dir_fdesc; int i,cnt; if(argc==1) //check for the file name { printf("USAGE: mkdir <filename>\n"); exit(0); } for(i=0;i<argc;i++) //open all the directory in given filenames { if(!(dir_fdesc=opendir(argv[i]))) { if(mkdir(argv[i],S_IRWXU|S_IRWXG|S_IRWXO)==-1);//this be the default directory modes printf("Perror-opendir\n"); } }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -