📅  最后修改于: 2022-03-11 15:04:37.929000             🧑  作者: Mango
/*
* This program displays the names of all files in the current directory.
*/
#include
#include
int main(void) {
DIR *d;
struct dirent *dir;
d = opendir(".");
if (d) {
while ((dir = readdir(d)) != NULL) {
printf("%s\n", dir->d_name);
}
closedir(d);
}
return(0);
}