diff --git a/TP2/ex2 b/TP2/ex2 index ae5f718..ad26759 100755 Binary files a/TP2/ex2 and b/TP2/ex2 differ diff --git a/TP2/ex2.c b/TP2/ex2.c index dadac04..3807599 100644 --- a/TP2/ex2.c +++ b/TP2/ex2.c @@ -125,8 +125,11 @@ void listDirContent(char *leDossier) fileAbsolPath = (char*)malloc(path_length); while((lesEntrees = readdir(dir))) { - fileAbsolPath = my_strcat((char *)leDossier, lesEntrees->d_name, path_length); - showFileInfos(fileAbsolPath); + if(lesEntrees->d_type == DT_REG || lesEntrees->d_type == DT_DIR) + { + fileAbsolPath = my_strcat((char *)leDossier, lesEntrees->d_name, path_length); //La consigne indique les fichiers, mais l'exemple montre aussi des dossiers... + showFileInfos(fileAbsolPath); + } } free(fileAbsolPath); closedir(dir);