列出输入目录的所有文件
#include <dirent.h>#include <stdio.h>#include <stdlib.h>int main(int argc, char* argv[]){ DIR* dir; if(argc < 2){ fprintf(stderr, "参数太少了!\n"); exit(1); } if((dir = opendir(argv[1])) == NULL){ fprintf(stderr, "打开目录%s失败!\n", argv[1]); exit(1); } dirent* dp; while((dp = readdir(dir)) != NULL){ fprintf(stdout, "%s %d\n", dp->d_name, dp->d_ino); } closedir(dir); exit(0);}?