📄 mydir.h
字号:
#include<sys/types.h>#include<dirent.h>#include<unistd.h>void mydir(char * str){ if(strcmp(str,"")==0) { char buf[80]; getcwd(buf,sizeof(buf)); DIR* dir; struct dirent *ptr; int i; dir=opendir(buf); while((ptr=readdir(dir))!=NULL) printf("%s\n",ptr->d_name); closedir(dir); } else { DIR* dir; struct dirent *ptr; int i; if((dir=opendir(str))!=NULL) { while((ptr=readdir(dir))!=NULL) printf("%s\n",ptr->d_name); closedir(dir); } else printf("There is not such file directory!\n"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -